@q00bs/agent-sdk 1.0.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/Q00bsAgent.d.ts +331 -0
- package/dist/Q00bsAgent.d.ts.map +1 -0
- package/dist/Q00bsAgent.js +695 -0
- package/dist/Q00bsAgent.js.map +1 -0
- package/dist/abis/AgentEscrow.d.ts +336 -0
- package/dist/abis/AgentEscrow.d.ts.map +1 -0
- package/dist/abis/AgentEscrow.js +206 -0
- package/dist/abis/AgentEscrow.js.map +1 -0
- package/dist/abis/AgentRegistry.d.ts +496 -0
- package/dist/abis/AgentRegistry.d.ts.map +1 -0
- package/dist/abis/AgentRegistry.js +280 -0
- package/dist/abis/AgentRegistry.js.map +1 -0
- package/dist/abis/ConsensusModule.d.ts +270 -0
- package/dist/abis/ConsensusModule.d.ts.map +1 -0
- package/dist/abis/ConsensusModule.js +157 -0
- package/dist/abis/ConsensusModule.js.map +1 -0
- package/dist/abis/ERC8004Identity.d.ts +293 -0
- package/dist/abis/ERC8004Identity.d.ts.map +1 -0
- package/dist/abis/ERC8004Identity.js +223 -0
- package/dist/abis/ERC8004Identity.js.map +1 -0
- package/dist/abis/ERC8004Reputation.d.ts +362 -0
- package/dist/abis/ERC8004Reputation.d.ts.map +1 -0
- package/dist/abis/ERC8004Reputation.js +229 -0
- package/dist/abis/ERC8004Reputation.js.map +1 -0
- package/dist/abis/ERC8004Validation.d.ts +234 -0
- package/dist/abis/ERC8004Validation.d.ts.map +1 -0
- package/dist/abis/ERC8004Validation.js +162 -0
- package/dist/abis/ERC8004Validation.js.map +1 -0
- package/dist/abis/Q00bFactory.d.ts +123 -0
- package/dist/abis/Q00bFactory.d.ts.map +1 -0
- package/dist/abis/Q00bFactory.js +65 -0
- package/dist/abis/Q00bFactory.js.map +1 -0
- package/dist/abis/TheQ00bs.d.ts +119 -0
- package/dist/abis/TheQ00bs.d.ts.map +1 -0
- package/dist/abis/TheQ00bs.js +73 -0
- package/dist/abis/TheQ00bs.js.map +1 -0
- package/dist/abis/index.d.ts +9 -0
- package/dist/abis/index.d.ts.map +1 -0
- package/dist/abis/index.js +17 -0
- package/dist/abis/index.js.map +1 -0
- package/dist/client.d.ts +111 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +134 -0
- package/dist/client.js.map +1 -0
- package/dist/consensus.d.ts +85 -0
- package/dist/consensus.d.ts.map +1 -0
- package/dist/consensus.js +227 -0
- package/dist/consensus.js.map +1 -0
- package/dist/constants.d.ts +85 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +113 -0
- package/dist/constants.js.map +1 -0
- package/dist/discovery.d.ts +70 -0
- package/dist/discovery.d.ts.map +1 -0
- package/dist/discovery.js +214 -0
- package/dist/discovery.js.map +1 -0
- package/dist/erc8004.d.ts +311 -0
- package/dist/erc8004.d.ts.map +1 -0
- package/dist/erc8004.js +824 -0
- package/dist/erc8004.js.map +1 -0
- package/dist/errors.d.ts +107 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +210 -0
- package/dist/errors.js.map +1 -0
- package/dist/escrow.d.ts +86 -0
- package/dist/escrow.d.ts.map +1 -0
- package/dist/escrow.js +267 -0
- package/dist/escrow.js.map +1 -0
- package/dist/index.d.ts +51 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +118 -0
- package/dist/index.js.map +1 -0
- package/dist/privy.d.ts +197 -0
- package/dist/privy.d.ts.map +1 -0
- package/dist/privy.js +524 -0
- package/dist/privy.js.map +1 -0
- package/dist/trust.d.ts +49 -0
- package/dist/trust.d.ts.map +1 -0
- package/dist/trust.js +117 -0
- package/dist/trust.js.map +1 -0
- package/dist/types.d.ts +472 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +36 -0
- package/dist/types.js.map +1 -0
- package/package.json +30 -0
package/dist/escrow.js
ADDED
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @q00bs/agent-sdk — Escrow Module
|
|
4
|
+
*
|
|
5
|
+
* Manages the full escrow lifecycle for agent-to-agent payments:
|
|
6
|
+
*
|
|
7
|
+
* 1. Client agent CREATES escrow → ETH is locked on-chain.
|
|
8
|
+
* 2. Service agent ACCEPTS the task.
|
|
9
|
+
* 3. Service agent marks COMPLETE with deliverable hash.
|
|
10
|
+
* 4. Client agent RELEASES funds (or DISPUTES / auto-REFUNDS on deadline).
|
|
11
|
+
*
|
|
12
|
+
* The AgentEscrow contract charges a 1% protocol fee on every creation.
|
|
13
|
+
* That fee goes to the Q00bs treasury (your monetization).
|
|
14
|
+
*
|
|
15
|
+
* SECURITY NOTES:
|
|
16
|
+
* - Spend limits are enforced on-chain by AgentRegistry.recordSpend().
|
|
17
|
+
* - Only the client's wallet can create/release; only the service's wallet can accept/complete.
|
|
18
|
+
* - Disputes are resolved by pre-authorized resolver addresses (set by contract owner).
|
|
19
|
+
*/
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.EscrowManager = void 0;
|
|
22
|
+
const viem_1 = require("viem");
|
|
23
|
+
const AgentEscrow_1 = require("./abis/AgentEscrow");
|
|
24
|
+
const errors_1 = require("./errors");
|
|
25
|
+
const constants_1 = require("./constants");
|
|
26
|
+
// ─────────────────────────────────────────────────────────────
|
|
27
|
+
// ESCROW MANAGER
|
|
28
|
+
// ─────────────────────────────────────────────────────────────
|
|
29
|
+
class EscrowManager {
|
|
30
|
+
publicClient;
|
|
31
|
+
walletClient;
|
|
32
|
+
escrowAddress;
|
|
33
|
+
logger;
|
|
34
|
+
constructor(publicClient, walletClient, escrowAddress, logger) {
|
|
35
|
+
this.publicClient = publicClient;
|
|
36
|
+
this.walletClient = walletClient;
|
|
37
|
+
this.escrowAddress = escrowAddress;
|
|
38
|
+
this.logger = logger;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Create a new escrow for an agent-to-agent task.
|
|
42
|
+
*
|
|
43
|
+
* @param clientAgentId - Your agent's on-chain ID (the payer).
|
|
44
|
+
* @param params - Task details, payment amount, and deadline.
|
|
45
|
+
* @returns The new escrow ID.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* const escrowId = await escrow.create(1, {
|
|
50
|
+
* serviceAgentId: 5,
|
|
51
|
+
* taskDescription: 'Summarize this dataset',
|
|
52
|
+
* paymentEth: '0.01',
|
|
53
|
+
* deadlineMs: Date.now() + 24 * 60 * 60 * 1000,
|
|
54
|
+
* });
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
async create(clientAgentId, params) {
|
|
58
|
+
const value = (0, viem_1.parseEther)(params.paymentEth);
|
|
59
|
+
const taskHash = (0, viem_1.keccak256)((0, viem_1.toHex)(params.taskDescription));
|
|
60
|
+
const deliverableHash = params.deliverableDescription
|
|
61
|
+
? (0, viem_1.keccak256)((0, viem_1.toHex)(params.deliverableDescription))
|
|
62
|
+
: (0, viem_1.keccak256)((0, viem_1.toHex)(''));
|
|
63
|
+
const deadline = BigInt(Math.floor((params.deadlineMs || Date.now() + constants_1.DEFAULT_ESCROW_DEADLINE_MS) / 1000));
|
|
64
|
+
this.logger.info(`Creating escrow: agent ${clientAgentId} → agent ${params.serviceAgentId}, ` +
|
|
65
|
+
`${params.paymentEth} ETH`);
|
|
66
|
+
try {
|
|
67
|
+
const hash = await this.walletClient.writeContract({
|
|
68
|
+
address: this.escrowAddress,
|
|
69
|
+
abi: AgentEscrow_1.AGENT_ESCROW_ABI,
|
|
70
|
+
functionName: 'createEscrow',
|
|
71
|
+
args: [
|
|
72
|
+
BigInt(clientAgentId),
|
|
73
|
+
BigInt(params.serviceAgentId),
|
|
74
|
+
taskHash,
|
|
75
|
+
deliverableHash,
|
|
76
|
+
deadline,
|
|
77
|
+
],
|
|
78
|
+
value,
|
|
79
|
+
});
|
|
80
|
+
this.logger.info(`Escrow creation tx: ${hash}`);
|
|
81
|
+
// Wait for confirmation
|
|
82
|
+
const receipt = await this.publicClient.waitForTransactionReceipt({ hash });
|
|
83
|
+
this.logger.info(`Escrow created in block ${receipt.blockNumber}`);
|
|
84
|
+
// Parse the escrow ID from the EscrowCreated event log
|
|
85
|
+
const escrowId = this.parseEscrowIdFromReceipt(receipt);
|
|
86
|
+
return escrowId;
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
90
|
+
if (msg.includes('Exceeds spend limits')) {
|
|
91
|
+
throw new errors_1.SpendLimitExceededError(params.paymentEth, 'on-chain limit');
|
|
92
|
+
}
|
|
93
|
+
throw new errors_1.ContractCallError(this.escrowAddress, 'createEscrow', msg);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Accept an escrow (called by the service agent).
|
|
98
|
+
*
|
|
99
|
+
* @param escrowId - The escrow to accept.
|
|
100
|
+
*/
|
|
101
|
+
async accept(escrowId) {
|
|
102
|
+
this.logger.info(`Accepting escrow ${escrowId}`);
|
|
103
|
+
try {
|
|
104
|
+
const hash = await this.walletClient.writeContract({
|
|
105
|
+
address: this.escrowAddress,
|
|
106
|
+
abi: AgentEscrow_1.AGENT_ESCROW_ABI,
|
|
107
|
+
functionName: 'acceptEscrow',
|
|
108
|
+
args: [BigInt(escrowId)],
|
|
109
|
+
});
|
|
110
|
+
await this.publicClient.waitForTransactionReceipt({ hash });
|
|
111
|
+
this.logger.info(`Escrow ${escrowId} accepted`);
|
|
112
|
+
return hash;
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
116
|
+
if (msg.includes('Invalid state')) {
|
|
117
|
+
throw new errors_1.EscrowStateError(escrowId, -1, 'accept');
|
|
118
|
+
}
|
|
119
|
+
throw new errors_1.ContractCallError(this.escrowAddress, 'acceptEscrow', msg);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Mark an escrow as complete (called by the service agent after finishing work).
|
|
124
|
+
*
|
|
125
|
+
* @param escrowId - The escrow to mark complete.
|
|
126
|
+
* @param deliverableDescription - Description of what was delivered.
|
|
127
|
+
*/
|
|
128
|
+
async markComplete(escrowId, deliverableDescription) {
|
|
129
|
+
const deliverableHash = (0, viem_1.keccak256)((0, viem_1.toHex)(deliverableDescription));
|
|
130
|
+
this.logger.info(`Marking escrow ${escrowId} complete`);
|
|
131
|
+
try {
|
|
132
|
+
const hash = await this.walletClient.writeContract({
|
|
133
|
+
address: this.escrowAddress,
|
|
134
|
+
abi: AgentEscrow_1.AGENT_ESCROW_ABI,
|
|
135
|
+
functionName: 'markComplete',
|
|
136
|
+
args: [BigInt(escrowId), deliverableHash],
|
|
137
|
+
});
|
|
138
|
+
await this.publicClient.waitForTransactionReceipt({ hash });
|
|
139
|
+
this.logger.info(`Escrow ${escrowId} marked complete`);
|
|
140
|
+
return hash;
|
|
141
|
+
}
|
|
142
|
+
catch (error) {
|
|
143
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
144
|
+
throw new errors_1.ContractCallError(this.escrowAddress, 'markComplete', msg);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Release escrowed funds to the service agent (called by the client agent).
|
|
149
|
+
*
|
|
150
|
+
* @param escrowId - The escrow to release.
|
|
151
|
+
*/
|
|
152
|
+
async release(escrowId) {
|
|
153
|
+
this.logger.info(`Releasing escrow ${escrowId}`);
|
|
154
|
+
try {
|
|
155
|
+
const hash = await this.walletClient.writeContract({
|
|
156
|
+
address: this.escrowAddress,
|
|
157
|
+
abi: AgentEscrow_1.AGENT_ESCROW_ABI,
|
|
158
|
+
functionName: 'releaseEscrow',
|
|
159
|
+
args: [BigInt(escrowId)],
|
|
160
|
+
});
|
|
161
|
+
await this.publicClient.waitForTransactionReceipt({ hash });
|
|
162
|
+
this.logger.info(`Escrow ${escrowId} released`);
|
|
163
|
+
return hash;
|
|
164
|
+
}
|
|
165
|
+
catch (error) {
|
|
166
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
167
|
+
throw new errors_1.ContractCallError(this.escrowAddress, 'releaseEscrow', msg);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Refund the escrow if the deadline has passed without completion.
|
|
172
|
+
*
|
|
173
|
+
* @param escrowId - The escrow to refund.
|
|
174
|
+
*/
|
|
175
|
+
async refund(escrowId) {
|
|
176
|
+
this.logger.info(`Requesting refund for escrow ${escrowId}`);
|
|
177
|
+
try {
|
|
178
|
+
const hash = await this.walletClient.writeContract({
|
|
179
|
+
address: this.escrowAddress,
|
|
180
|
+
abi: AgentEscrow_1.AGENT_ESCROW_ABI,
|
|
181
|
+
functionName: 'refundEscrow',
|
|
182
|
+
args: [BigInt(escrowId)],
|
|
183
|
+
});
|
|
184
|
+
await this.publicClient.waitForTransactionReceipt({ hash });
|
|
185
|
+
this.logger.info(`Escrow ${escrowId} refunded`);
|
|
186
|
+
return hash;
|
|
187
|
+
}
|
|
188
|
+
catch (error) {
|
|
189
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
190
|
+
throw new errors_1.ContractCallError(this.escrowAddress, 'refundEscrow', msg);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Dispute a completed escrow.
|
|
195
|
+
*
|
|
196
|
+
* @param escrowId - The escrow to dispute.
|
|
197
|
+
* @param evidence - Evidence description for the dispute.
|
|
198
|
+
*/
|
|
199
|
+
async dispute(escrowId, evidence) {
|
|
200
|
+
const evidenceHash = (0, viem_1.keccak256)((0, viem_1.toHex)(evidence));
|
|
201
|
+
this.logger.info(`Disputing escrow ${escrowId}`);
|
|
202
|
+
try {
|
|
203
|
+
const hash = await this.walletClient.writeContract({
|
|
204
|
+
address: this.escrowAddress,
|
|
205
|
+
abi: AgentEscrow_1.AGENT_ESCROW_ABI,
|
|
206
|
+
functionName: 'disputeEscrow',
|
|
207
|
+
args: [BigInt(escrowId), evidenceHash],
|
|
208
|
+
});
|
|
209
|
+
await this.publicClient.waitForTransactionReceipt({ hash });
|
|
210
|
+
this.logger.info(`Escrow ${escrowId} disputed`);
|
|
211
|
+
return hash;
|
|
212
|
+
}
|
|
213
|
+
catch (error) {
|
|
214
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
215
|
+
throw new errors_1.ContractCallError(this.escrowAddress, 'disputeEscrow', msg);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Read an escrow record from the chain.
|
|
220
|
+
*
|
|
221
|
+
* @param escrowId - The escrow to query.
|
|
222
|
+
* @returns The full escrow record.
|
|
223
|
+
*/
|
|
224
|
+
async get(escrowId) {
|
|
225
|
+
const raw = await this.publicClient.readContract({
|
|
226
|
+
address: this.escrowAddress,
|
|
227
|
+
abi: AgentEscrow_1.AGENT_ESCROW_ABI,
|
|
228
|
+
functionName: 'getEscrow',
|
|
229
|
+
args: [BigInt(escrowId)],
|
|
230
|
+
});
|
|
231
|
+
return {
|
|
232
|
+
id: escrowId,
|
|
233
|
+
clientAgentId: Number(raw.clientAgentId),
|
|
234
|
+
serviceAgentId: Number(raw.serviceAgentId),
|
|
235
|
+
amount: raw.amount,
|
|
236
|
+
protocolFee: raw.protocolFee,
|
|
237
|
+
taskHash: raw.taskHash,
|
|
238
|
+
deliverableHash: raw.deliverableHash,
|
|
239
|
+
state: Number(raw.state),
|
|
240
|
+
createdAt: Number(raw.createdAt),
|
|
241
|
+
deadline: Number(raw.deadline),
|
|
242
|
+
completedAt: Number(raw.completedAt),
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
// ── Private helpers ─────────────────────────────────────────
|
|
246
|
+
parseEscrowIdFromReceipt(receipt) {
|
|
247
|
+
// Look for the EscrowCreated event in the receipt logs
|
|
248
|
+
for (const log of receipt.logs) {
|
|
249
|
+
try {
|
|
250
|
+
if (log.address?.toLowerCase() === this.escrowAddress.toLowerCase()) {
|
|
251
|
+
// EscrowCreated event has escrowId as first indexed topic
|
|
252
|
+
if (log.topics && log.topics.length > 1) {
|
|
253
|
+
return Number(BigInt(log.topics[1]));
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
catch {
|
|
258
|
+
continue;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
// Fallback: read escrowCount and subtract 1
|
|
262
|
+
this.logger.warn('Could not parse escrowId from receipt, reading escrowCount');
|
|
263
|
+
return -1;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
exports.EscrowManager = EscrowManager;
|
|
267
|
+
//# sourceMappingURL=escrow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"escrow.js","sourceRoot":"","sources":["../src/escrow.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AAGH,+BAAoD;AACpD,oDAAsD;AACtD,qCAAwF;AAExF,2CAAyD;AAEzD,gEAAgE;AAChE,iBAAiB;AACjB,gEAAgE;AAEhE,MAAa,aAAa;IAChB,YAAY,CAAiC;IAC7C,YAAY,CAA0C;IACtD,aAAa,CAAgB;IAC7B,MAAM,CAAS;IAEvB,YACE,YAA4C,EAC5C,YAAqD,EACrD,aAAqB,EACrB,MAAc;QAEd,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,aAAa,GAAG,aAA8B,CAAC;QACpD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,KAAK,CAAC,MAAM,CAAC,aAAqB,EAAE,MAA0B;QAC5D,MAAM,KAAK,GAAG,IAAA,iBAAU,EAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAC5C,MAAM,QAAQ,GAAG,IAAA,gBAAS,EAAC,IAAA,YAAK,EAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC;QAC1D,MAAM,eAAe,GAAG,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,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;oBACvC,CAAC;gBACH,CAAC;YACH,CAAC;YAAC,MAAM,CAAC;gBACP,SAAS;YACX,CAAC;QACH,CAAC;QACD,4CAA4C;QAC5C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,4DAA4D,CAAC,CAAC;QAC/E,OAAO,CAAC,CAAC,CAAC;IACZ,CAAC;CACF;AAxQD,sCAwQC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @q00bs/agent-sdk
|
|
3
|
+
*
|
|
4
|
+
* TypeScript SDK for building trust-verified AI agents on the Q00bs network.
|
|
5
|
+
*
|
|
6
|
+
* QUICK START:
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { Q00bsAgent } from '@q00bs/agent-sdk';
|
|
9
|
+
*
|
|
10
|
+
* const agent = new Q00bsAgent({
|
|
11
|
+
* privateKey: process.env.AGENT_PRIVATE_KEY!,
|
|
12
|
+
* rpcUrl: process.env.BASE_RPC_URL!,
|
|
13
|
+
* registryAddress: process.env.REGISTRY_ADDRESS!,
|
|
14
|
+
* escrowAddress: process.env.ESCROW_ADDRESS!,
|
|
15
|
+
* consensusAddress: process.env.CONSENSUS_ADDRESS!,
|
|
16
|
+
* });
|
|
17
|
+
*
|
|
18
|
+
* await agent.initialize();
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* ARCHITECTURE:
|
|
22
|
+
* Q00bsAgent (this file's default export)
|
|
23
|
+
* ├── TrustResolver — trust-path queries
|
|
24
|
+
* ├── EscrowManager — agent-to-agent payments
|
|
25
|
+
* ├── ConsensusManager — multi-agent voting
|
|
26
|
+
* └── AgentDiscovery — find peer agents
|
|
27
|
+
*
|
|
28
|
+
* All sub-modules are also exported for advanced use cases.
|
|
29
|
+
*/
|
|
30
|
+
export { Q00bsAgent } from './Q00bsAgent';
|
|
31
|
+
export { TrustResolver } from './trust';
|
|
32
|
+
export { EscrowManager } from './escrow';
|
|
33
|
+
export { ConsensusManager } from './consensus';
|
|
34
|
+
export { AgentDiscovery } from './discovery';
|
|
35
|
+
export { createClients, createPrivyClients, createLogger } from './client';
|
|
36
|
+
export type { ClientConfig, PrivyClientConfig, BlockchainClients } from './client';
|
|
37
|
+
export { PrivyWalletManager } from './privy';
|
|
38
|
+
export { ERC8004Manager } from './erc8004';
|
|
39
|
+
export type { AgentConfig, AgentRecord, AgentPermissions, TrustPath, AgentQuery, DiscoveredAgent, CreateEscrowParams, EscrowRecord, ConsensusParams, ConsensusResult, ConsensusRecord, Logger, PrivyConfig, PrivyWalletPolicy, PrivyPolicyRule, PrivyWalletInfo, PrivyTransactionRequest, PrivyTransactionResult, ERC8004Config, ERC8004AgentIdentifier, ERC8004Identity, ERC8004Feedback, ERC8004ReputationSummary, ERC8004ValidationResult, ERC8004ValidationSummary, GiveFeedbackParams, } from './types';
|
|
40
|
+
export { EscrowState, ConsensusState } from './types';
|
|
41
|
+
export { Q00bsError, AgentNotRegisteredError, TrustPathNotFoundError, InsufficientTrustError, SpendLimitExceededError, EscrowStateError, ConsensusTimeoutError, ConsensusRejectedError, AgentInactiveError, ContractCallError, PrivyWalletError, PrivyPolicyViolationError, PrivyApiError, ERC8004Error, ERC8004IdentityNotFoundError, ERC8004SelfFeedbackError, ERC8004RegistryError, ERC8004NotConfiguredError, } from './errors';
|
|
42
|
+
export { BASE_CHAIN_ID, DEFAULT_RPC_URL, Q00B_FACTORY_ADDRESS, GENESIS_Q00B_ADDRESS, AGENT_REGISTRY_ADDRESS, AGENT_ESCROW_ADDRESS, CONSENSUS_MODULE_ADDRESS, MAX_TRUST_SCORE, TRUST_DECAY_PER_HOP_PERCENT, PROTOCOL_FEE_BPS, DEFAULT_MAX_HOPS, ERC8004_IDENTITY_REGISTRY_ADDRESS, ERC8004_REPUTATION_REGISTRY_ADDRESS, ERC8004_VALIDATION_REGISTRY_ADDRESS, ERC8004_NAMESPACE, } from './constants';
|
|
43
|
+
export { Q00B_FACTORY_ABI } from './abis/Q00bFactory';
|
|
44
|
+
export { THE_Q00BS_ABI } from './abis/TheQ00bs';
|
|
45
|
+
export { AGENT_REGISTRY_ABI } from './abis/AgentRegistry';
|
|
46
|
+
export { AGENT_ESCROW_ABI } from './abis/AgentEscrow';
|
|
47
|
+
export { CONSENSUS_MODULE_ABI } from './abis/ConsensusModule';
|
|
48
|
+
export { ERC8004_IDENTITY_ABI } from './abis/ERC8004Identity';
|
|
49
|
+
export { ERC8004_REPUTATION_ABI } from './abis/ERC8004Reputation';
|
|
50
|
+
export { ERC8004_VALIDATION_ABI } from './abis/ERC8004Validation';
|
|
51
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC3E,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAGnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAG7C,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAG3C,YAAY,EACV,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,SAAS,EACT,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,eAAe,EACf,e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E,MAAM,0BAA0B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @q00bs/agent-sdk
|
|
4
|
+
*
|
|
5
|
+
* TypeScript SDK for building trust-verified AI agents on the Q00bs network.
|
|
6
|
+
*
|
|
7
|
+
* QUICK START:
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { Q00bsAgent } from '@q00bs/agent-sdk';
|
|
10
|
+
*
|
|
11
|
+
* const agent = new Q00bsAgent({
|
|
12
|
+
* privateKey: process.env.AGENT_PRIVATE_KEY!,
|
|
13
|
+
* rpcUrl: process.env.BASE_RPC_URL!,
|
|
14
|
+
* registryAddress: process.env.REGISTRY_ADDRESS!,
|
|
15
|
+
* escrowAddress: process.env.ESCROW_ADDRESS!,
|
|
16
|
+
* consensusAddress: process.env.CONSENSUS_ADDRESS!,
|
|
17
|
+
* });
|
|
18
|
+
*
|
|
19
|
+
* await agent.initialize();
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* ARCHITECTURE:
|
|
23
|
+
* Q00bsAgent (this file's default export)
|
|
24
|
+
* ├── TrustResolver — trust-path queries
|
|
25
|
+
* ├── EscrowManager — agent-to-agent payments
|
|
26
|
+
* ├── ConsensusManager — multi-agent voting
|
|
27
|
+
* └── AgentDiscovery — find peer agents
|
|
28
|
+
*
|
|
29
|
+
* All sub-modules are also exported for advanced use cases.
|
|
30
|
+
*/
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
exports.CONSENSUS_MODULE_ABI = exports.AGENT_ESCROW_ABI = exports.AGENT_REGISTRY_ABI = exports.THE_Q00BS_ABI = exports.Q00B_FACTORY_ABI = exports.ERC8004_NAMESPACE = exports.ERC8004_VALIDATION_REGISTRY_ADDRESS = exports.ERC8004_REPUTATION_REGISTRY_ADDRESS = exports.ERC8004_IDENTITY_REGISTRY_ADDRESS = exports.DEFAULT_MAX_HOPS = exports.PROTOCOL_FEE_BPS = exports.TRUST_DECAY_PER_HOP_PERCENT = exports.MAX_TRUST_SCORE = exports.CONSENSUS_MODULE_ADDRESS = exports.AGENT_ESCROW_ADDRESS = exports.AGENT_REGISTRY_ADDRESS = exports.GENESIS_Q00B_ADDRESS = exports.Q00B_FACTORY_ADDRESS = exports.DEFAULT_RPC_URL = exports.BASE_CHAIN_ID = exports.ERC8004NotConfiguredError = exports.ERC8004RegistryError = exports.ERC8004SelfFeedbackError = exports.ERC8004IdentityNotFoundError = exports.ERC8004Error = exports.PrivyApiError = exports.PrivyPolicyViolationError = exports.PrivyWalletError = exports.ContractCallError = exports.AgentInactiveError = exports.ConsensusRejectedError = exports.ConsensusTimeoutError = exports.EscrowStateError = exports.SpendLimitExceededError = exports.InsufficientTrustError = exports.TrustPathNotFoundError = exports.AgentNotRegisteredError = exports.Q00bsError = exports.ConsensusState = exports.EscrowState = exports.ERC8004Manager = exports.PrivyWalletManager = exports.createLogger = exports.createPrivyClients = exports.createClients = exports.AgentDiscovery = exports.ConsensusManager = exports.EscrowManager = exports.TrustResolver = exports.Q00bsAgent = void 0;
|
|
33
|
+
exports.ERC8004_VALIDATION_ABI = exports.ERC8004_REPUTATION_ABI = exports.ERC8004_IDENTITY_ABI = void 0;
|
|
34
|
+
// ── Main class ────────────────────────────────────────────────
|
|
35
|
+
var Q00bsAgent_1 = require("./Q00bsAgent");
|
|
36
|
+
Object.defineProperty(exports, "Q00bsAgent", { enumerable: true, get: function () { return Q00bsAgent_1.Q00bsAgent; } });
|
|
37
|
+
// ── Sub-modules (for advanced use) ────────────────────────────
|
|
38
|
+
var trust_1 = require("./trust");
|
|
39
|
+
Object.defineProperty(exports, "TrustResolver", { enumerable: true, get: function () { return trust_1.TrustResolver; } });
|
|
40
|
+
var escrow_1 = require("./escrow");
|
|
41
|
+
Object.defineProperty(exports, "EscrowManager", { enumerable: true, get: function () { return escrow_1.EscrowManager; } });
|
|
42
|
+
var consensus_1 = require("./consensus");
|
|
43
|
+
Object.defineProperty(exports, "ConsensusManager", { enumerable: true, get: function () { return consensus_1.ConsensusManager; } });
|
|
44
|
+
var discovery_1 = require("./discovery");
|
|
45
|
+
Object.defineProperty(exports, "AgentDiscovery", { enumerable: true, get: function () { return discovery_1.AgentDiscovery; } });
|
|
46
|
+
// ── Blockchain client factory ─────────────────────────────────
|
|
47
|
+
var client_1 = require("./client");
|
|
48
|
+
Object.defineProperty(exports, "createClients", { enumerable: true, get: function () { return client_1.createClients; } });
|
|
49
|
+
Object.defineProperty(exports, "createPrivyClients", { enumerable: true, get: function () { return client_1.createPrivyClients; } });
|
|
50
|
+
Object.defineProperty(exports, "createLogger", { enumerable: true, get: function () { return client_1.createLogger; } });
|
|
51
|
+
// ── Privy wallet integration ─────────────────────────────────
|
|
52
|
+
var privy_1 = require("./privy");
|
|
53
|
+
Object.defineProperty(exports, "PrivyWalletManager", { enumerable: true, get: function () { return privy_1.PrivyWalletManager; } });
|
|
54
|
+
// ── ERC-8004 Trustless Agents ─────────────────────────────────
|
|
55
|
+
var erc8004_1 = require("./erc8004");
|
|
56
|
+
Object.defineProperty(exports, "ERC8004Manager", { enumerable: true, get: function () { return erc8004_1.ERC8004Manager; } });
|
|
57
|
+
var types_1 = require("./types");
|
|
58
|
+
Object.defineProperty(exports, "EscrowState", { enumerable: true, get: function () { return types_1.EscrowState; } });
|
|
59
|
+
Object.defineProperty(exports, "ConsensusState", { enumerable: true, get: function () { return types_1.ConsensusState; } });
|
|
60
|
+
// ── Errors ────────────────────────────────────────────────────
|
|
61
|
+
var errors_1 = require("./errors");
|
|
62
|
+
Object.defineProperty(exports, "Q00bsError", { enumerable: true, get: function () { return errors_1.Q00bsError; } });
|
|
63
|
+
Object.defineProperty(exports, "AgentNotRegisteredError", { enumerable: true, get: function () { return errors_1.AgentNotRegisteredError; } });
|
|
64
|
+
Object.defineProperty(exports, "TrustPathNotFoundError", { enumerable: true, get: function () { return errors_1.TrustPathNotFoundError; } });
|
|
65
|
+
Object.defineProperty(exports, "InsufficientTrustError", { enumerable: true, get: function () { return errors_1.InsufficientTrustError; } });
|
|
66
|
+
Object.defineProperty(exports, "SpendLimitExceededError", { enumerable: true, get: function () { return errors_1.SpendLimitExceededError; } });
|
|
67
|
+
Object.defineProperty(exports, "EscrowStateError", { enumerable: true, get: function () { return errors_1.EscrowStateError; } });
|
|
68
|
+
Object.defineProperty(exports, "ConsensusTimeoutError", { enumerable: true, get: function () { return errors_1.ConsensusTimeoutError; } });
|
|
69
|
+
Object.defineProperty(exports, "ConsensusRejectedError", { enumerable: true, get: function () { return errors_1.ConsensusRejectedError; } });
|
|
70
|
+
Object.defineProperty(exports, "AgentInactiveError", { enumerable: true, get: function () { return errors_1.AgentInactiveError; } });
|
|
71
|
+
Object.defineProperty(exports, "ContractCallError", { enumerable: true, get: function () { return errors_1.ContractCallError; } });
|
|
72
|
+
// Privy errors
|
|
73
|
+
Object.defineProperty(exports, "PrivyWalletError", { enumerable: true, get: function () { return errors_1.PrivyWalletError; } });
|
|
74
|
+
Object.defineProperty(exports, "PrivyPolicyViolationError", { enumerable: true, get: function () { return errors_1.PrivyPolicyViolationError; } });
|
|
75
|
+
Object.defineProperty(exports, "PrivyApiError", { enumerable: true, get: function () { return errors_1.PrivyApiError; } });
|
|
76
|
+
// ERC-8004 errors
|
|
77
|
+
Object.defineProperty(exports, "ERC8004Error", { enumerable: true, get: function () { return errors_1.ERC8004Error; } });
|
|
78
|
+
Object.defineProperty(exports, "ERC8004IdentityNotFoundError", { enumerable: true, get: function () { return errors_1.ERC8004IdentityNotFoundError; } });
|
|
79
|
+
Object.defineProperty(exports, "ERC8004SelfFeedbackError", { enumerable: true, get: function () { return errors_1.ERC8004SelfFeedbackError; } });
|
|
80
|
+
Object.defineProperty(exports, "ERC8004RegistryError", { enumerable: true, get: function () { return errors_1.ERC8004RegistryError; } });
|
|
81
|
+
Object.defineProperty(exports, "ERC8004NotConfiguredError", { enumerable: true, get: function () { return errors_1.ERC8004NotConfiguredError; } });
|
|
82
|
+
// ── Constants ─────────────────────────────────────────────────
|
|
83
|
+
var constants_1 = require("./constants");
|
|
84
|
+
Object.defineProperty(exports, "BASE_CHAIN_ID", { enumerable: true, get: function () { return constants_1.BASE_CHAIN_ID; } });
|
|
85
|
+
Object.defineProperty(exports, "DEFAULT_RPC_URL", { enumerable: true, get: function () { return constants_1.DEFAULT_RPC_URL; } });
|
|
86
|
+
Object.defineProperty(exports, "Q00B_FACTORY_ADDRESS", { enumerable: true, get: function () { return constants_1.Q00B_FACTORY_ADDRESS; } });
|
|
87
|
+
Object.defineProperty(exports, "GENESIS_Q00B_ADDRESS", { enumerable: true, get: function () { return constants_1.GENESIS_Q00B_ADDRESS; } });
|
|
88
|
+
Object.defineProperty(exports, "AGENT_REGISTRY_ADDRESS", { enumerable: true, get: function () { return constants_1.AGENT_REGISTRY_ADDRESS; } });
|
|
89
|
+
Object.defineProperty(exports, "AGENT_ESCROW_ADDRESS", { enumerable: true, get: function () { return constants_1.AGENT_ESCROW_ADDRESS; } });
|
|
90
|
+
Object.defineProperty(exports, "CONSENSUS_MODULE_ADDRESS", { enumerable: true, get: function () { return constants_1.CONSENSUS_MODULE_ADDRESS; } });
|
|
91
|
+
Object.defineProperty(exports, "MAX_TRUST_SCORE", { enumerable: true, get: function () { return constants_1.MAX_TRUST_SCORE; } });
|
|
92
|
+
Object.defineProperty(exports, "TRUST_DECAY_PER_HOP_PERCENT", { enumerable: true, get: function () { return constants_1.TRUST_DECAY_PER_HOP_PERCENT; } });
|
|
93
|
+
Object.defineProperty(exports, "PROTOCOL_FEE_BPS", { enumerable: true, get: function () { return constants_1.PROTOCOL_FEE_BPS; } });
|
|
94
|
+
Object.defineProperty(exports, "DEFAULT_MAX_HOPS", { enumerable: true, get: function () { return constants_1.DEFAULT_MAX_HOPS; } });
|
|
95
|
+
// ERC-8004 constants
|
|
96
|
+
Object.defineProperty(exports, "ERC8004_IDENTITY_REGISTRY_ADDRESS", { enumerable: true, get: function () { return constants_1.ERC8004_IDENTITY_REGISTRY_ADDRESS; } });
|
|
97
|
+
Object.defineProperty(exports, "ERC8004_REPUTATION_REGISTRY_ADDRESS", { enumerable: true, get: function () { return constants_1.ERC8004_REPUTATION_REGISTRY_ADDRESS; } });
|
|
98
|
+
Object.defineProperty(exports, "ERC8004_VALIDATION_REGISTRY_ADDRESS", { enumerable: true, get: function () { return constants_1.ERC8004_VALIDATION_REGISTRY_ADDRESS; } });
|
|
99
|
+
Object.defineProperty(exports, "ERC8004_NAMESPACE", { enumerable: true, get: function () { return constants_1.ERC8004_NAMESPACE; } });
|
|
100
|
+
// ── ABIs (for direct contract interaction) ────────────────────
|
|
101
|
+
var Q00bFactory_1 = require("./abis/Q00bFactory");
|
|
102
|
+
Object.defineProperty(exports, "Q00B_FACTORY_ABI", { enumerable: true, get: function () { return Q00bFactory_1.Q00B_FACTORY_ABI; } });
|
|
103
|
+
var TheQ00bs_1 = require("./abis/TheQ00bs");
|
|
104
|
+
Object.defineProperty(exports, "THE_Q00BS_ABI", { enumerable: true, get: function () { return TheQ00bs_1.THE_Q00BS_ABI; } });
|
|
105
|
+
var AgentRegistry_1 = require("./abis/AgentRegistry");
|
|
106
|
+
Object.defineProperty(exports, "AGENT_REGISTRY_ABI", { enumerable: true, get: function () { return AgentRegistry_1.AGENT_REGISTRY_ABI; } });
|
|
107
|
+
var AgentEscrow_1 = require("./abis/AgentEscrow");
|
|
108
|
+
Object.defineProperty(exports, "AGENT_ESCROW_ABI", { enumerable: true, get: function () { return AgentEscrow_1.AGENT_ESCROW_ABI; } });
|
|
109
|
+
var ConsensusModule_1 = require("./abis/ConsensusModule");
|
|
110
|
+
Object.defineProperty(exports, "CONSENSUS_MODULE_ABI", { enumerable: true, get: function () { return ConsensusModule_1.CONSENSUS_MODULE_ABI; } });
|
|
111
|
+
// ── ERC-8004 ABIs ─────────────────────────────────────────────
|
|
112
|
+
var ERC8004Identity_1 = require("./abis/ERC8004Identity");
|
|
113
|
+
Object.defineProperty(exports, "ERC8004_IDENTITY_ABI", { enumerable: true, get: function () { return ERC8004Identity_1.ERC8004_IDENTITY_ABI; } });
|
|
114
|
+
var ERC8004Reputation_1 = require("./abis/ERC8004Reputation");
|
|
115
|
+
Object.defineProperty(exports, "ERC8004_REPUTATION_ABI", { enumerable: true, get: function () { return ERC8004Reputation_1.ERC8004_REPUTATION_ABI; } });
|
|
116
|
+
var ERC8004Validation_1 = require("./abis/ERC8004Validation");
|
|
117
|
+
Object.defineProperty(exports, "ERC8004_VALIDATION_ABI", { enumerable: true, get: function () { return ERC8004Validation_1.ERC8004_VALIDATION_ABI; } });
|
|
118
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;;;;AAEH,iEAAiE;AACjE,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AAEnB,iEAAiE;AACjE,iCAAwC;AAA/B,sGAAA,aAAa,OAAA;AACtB,mCAAyC;AAAhC,uGAAA,aAAa,OAAA;AACtB,yCAA+C;AAAtC,6GAAA,gBAAgB,OAAA;AACzB,yCAA6C;AAApC,2GAAA,cAAc,OAAA;AAEvB,iEAAiE;AACjE,mCAA2E;AAAlE,uGAAA,aAAa,OAAA;AAAE,4GAAA,kBAAkB,OAAA;AAAE,sGAAA,YAAY,OAAA;AAGxD,gEAAgE;AAChE,iCAA6C;AAApC,2GAAA,kBAAkB,OAAA;AAE3B,iEAAiE;AACjE,qCAA2C;AAAlC,yGAAA,cAAc,OAAA;AAkCvB,iCAAsD;AAA7C,oGAAA,WAAW,OAAA;AAAE,uGAAA,cAAc,OAAA;AAEpC,iEAAiE;AACjE,mCAqBkB;AApBhB,oGAAA,UAAU,OAAA;AACV,iHAAA,uBAAuB,OAAA;AACvB,gHAAA,sBAAsB,OAAA;AACtB,gHAAA,sBAAsB,OAAA;AACtB,iHAAA,uBAAuB,OAAA;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