@agether/agether 1.4.2 → 1.5.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @agether/agether
2
2
 
3
- OpenClaw plugin for **Agether** — on-chain credit protocol for AI agents on Base.
3
+ OpenClaw plugin for **Agether** — onchain credit protocol for AI agents on Base.
4
4
 
5
5
  ## Prerequisites
6
6
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "agether",
3
3
  "name": "Agether Credit",
4
- "description": "On-chain credit protocol for AI agents — Morpho-backed overcollateralized credit, ERC-8004 identity, x402 payments",
4
+ "description": "Onchain credit protocol for AI agents — Morpho-backed overcollateralized credit, ERC-8004 identity, x402 payments",
5
5
  "version": "1.2.0",
6
6
  "skills": ["skills/agether"],
7
7
  "configSchema": {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@agether/agether",
3
- "version": "1.4.2",
4
- "description": "OpenClaw plugin for Agether — on-chain credit for AI agents",
3
+ "version": "1.5.0",
4
+ "description": "OpenClaw plugin for Agether — onchain credit for AI agents",
5
5
  "main": "src/index.ts",
6
6
  "openclaw": {
7
7
  "extensions": [
@@ -9,7 +9,7 @@
9
9
  ]
10
10
  },
11
11
  "dependencies": {
12
- "@agether/sdk": "^1.11.2",
12
+ "@agether/sdk": "^2.1.0",
13
13
  "axios": "^1.6.0",
14
14
  "ethers": "^6.9.0"
15
15
  },
@@ -33,7 +33,7 @@ If you don't paste it, the user sees NOTHING. An empty colon ":" with no data af
33
33
  8. **When user says "register" → ALWAYS call `agether_register`.** A wallet CAN have multiple ERC-8004 identities. The tool handles everything. Never refuse to register because the wallet "already has an identity". Just call the tool.
34
34
  9. **Never guess about blockchain state.** If you're unsure, call the tool. Don't tell the user something is impossible — try it first.
35
35
  10. **Your EOA wallet IS the user's wallet.** Same private key, same address. If the user says "I have WETH", call `agether_balance` — you'll see it in the `collateral` field. You already have access to those tokens.
36
- 11. **`morpho_deposit` and `morpho_deposit_and_borrow` transfer collateral from your EOA automatically.** You do NOT need anyone to "send you" tokens. If your EOA has WETH, just call the deposit tool directly. The SDK handles EOA→AgentAccount→Morpho in one flow.
36
+ 11. **`morpho_deposit` and `morpho_deposit_and_borrow` transfer collateral from your EOA automatically.** You do NOT need anyone to "send you" tokens. If your EOA has WETH, just call the deposit tool directly. The SDK handles EOA→Safe account→Morpho in one flow.
37
37
  12. **To get USDC for x402:** call `morpho_deposit_and_borrow` with collateral from your EOA. Do NOT ask the user to send tokens — check your balance first.
38
38
 
39
39
  ---
@@ -62,11 +62,11 @@ Both `agether_set_agent` and `agether_register` save the agentId to config perma
62
62
  ### Identity & Wallet
63
63
  | Tool | What it does |
64
64
  |------|-------------|
65
- | `agether_balance` | Show ETH + USDC + collateral (WETH/wstETH/cbETH) balances for both EOA wallet and AgentAccount |
66
- | `agether_register` | Register on-chain: mints ERC-8004 identity NFT + creates AgentAccount. Auto-saves agentId to config. |
65
+ | `agether_balance` | Show ETH + USDC + collateral (WETH/wstETH/cbETH) balances for both EOA wallet and Safe account |
66
+ | `agether_register` | Register on-chain: mints ERC-8004 identity NFT + creates Safe account (via Safe7579). Auto-saves agentId to config. |
67
67
  | `agether_set_agent` | Set a known agentId (e.g. from memory) and save to config. Use when agentId is "?" but you remember it. |
68
68
  | `agether_score` | Get credit score. `refresh: false` = free read. `refresh: true` = pays x402, computes fresh score on-chain. **Always call this when user asks about score.** |
69
- | `wallet_fund` | Transfer USDC from EOA wallet → AgentAccount |
69
+ | `wallet_fund` | Transfer USDC from EOA wallet → Safe account |
70
70
 
71
71
  ### Morpho Credit (Overcollateralized — instant, no approval)
72
72
  | Tool | Params | What it does |
@@ -75,8 +75,8 @@ Both `agether_set_agent` and `agether_register` save the agentId to config perma
75
75
  | `morpho_status` | none | Show all Morpho positions (collateral + debt) |
76
76
  | `morpho_deposit` | `amount`, `token` | Deposit collateral from EOA → Morpho (no borrow) |
77
77
  | `morpho_deposit_and_borrow` | `collateralAmount`, `token`, `borrowAmount` | Deposit + borrow in one flow. **Best for first-time setup** |
78
- | `morpho_borrow` | `amount` (USD) | Borrow USDC against existing collateral → lands in AgentAccount |
79
- | `morpho_repay` | `amount` (USD) | Repay USDC debt from AgentAccount → Morpho |
78
+ | `morpho_borrow` | `amount` (USD) | Borrow USDC against existing collateral → lands in Safe account |
79
+ | `morpho_repay` | `amount` (USD) | Repay USDC debt from Safe account → Morpho |
80
80
  | `morpho_withdraw` | `amount` (or "all"), `token` | Withdraw collateral back to EOA wallet |
81
81
  | `morpho_sponsor` | `agentId`/`agentAddress`, `amount`, `token`, `borrow?` | Deposit collateral for another agent |
82
82
 
@@ -97,8 +97,8 @@ Both `agether_set_agent` and `agether_register` save the agentId to config perma
97
97
 
98
98
  ### User asks to call a paid API (x402)
99
99
  ```
100
- 1. agether_balance → check USDC in AgentAccount AND collateral on EOA
101
- 2. IF AgentAccount has USDC ≥ $0.01:
100
+ 1. agether_balance → check USDC in Safe account AND collateral on EOA
101
+ 2. IF Safe account has USDC ≥ $0.01:
102
102
  → x402_pay(url)
103
103
  3. IF no USDC but has collateral deposited in Morpho:
104
104
  → morpho_borrow(amount: "1") ← borrow $1
@@ -203,7 +203,7 @@ If something **fails**:
203
203
  | `Payment rejected (402)` | No USDC for x402 payment | Borrow USDC first: `morpho_borrow` or `morpho_deposit_and_borrow` |
204
204
  | `No collateral deposited` | Trying to borrow without collateral | `morpho_deposit` first |
205
205
  | `Insufficient WETH/wstETH/cbETH` | EOA doesn't have enough collateral | Tell user to send collateral to EOA address |
206
- | `Insufficient USDC in AgentAccount` | Not enough USDC for repay | Need to fund AgentAccount or borrow more |
206
+ | `Insufficient USDC in AgentAccount` | Not enough USDC for repay | Need to fund Safe account or borrow more |
207
207
  | `ExecutionFailed` | Smart contract call reverted | Check inner error, usually LTV or approval issue |
208
208
 
209
209
  ---
@@ -213,14 +213,15 @@ If something **fails**:
213
213
  ```
214
214
  EOA Wallet (private key)
215
215
  ├── Owns ERC-8004 Identity NFT (agentId) ← can own MULTIPLE
216
- └── Owns AgentAccount (smart wallet, 1 per agentId)
216
+ └── Owns Safe Account (via Safe7579 + ERC-4337, 1 per agentId)
217
217
  ├── Holds USDC (from borrows)
218
- └── Executes Morpho Blue operations via executeBatch()
218
+ ├── ERC8004ValidationModule validates ownership + KYA gate
219
+ └── Executes Morpho Blue operations via ERC-4337 UserOps through EntryPoint
219
220
 
220
221
  Morpho Blue (direct lending, overcollateralized 125%)
221
222
  ├── supplyCollateral() → collateral into Morpho Blue market
222
- ├── borrow() → USDC from Morpho Blue → AgentAccount
223
- ├── repay() → USDC from AgentAccount → Morpho Blue
223
+ ├── borrow() → USDC from Morpho Blue → Safe Account
224
+ ├── repay() → USDC from Safe Account → Morpho Blue
224
225
  └── withdrawCollateral() → collateral back to EOA
225
226
  ```
226
227
 
@@ -230,10 +231,17 @@ Morpho Blue (direct lending, overcollateralized 125%)
230
231
 
231
232
  | Contract | Address |
232
233
  |----------|---------|
233
- | AccountFactory | `0x89a8758E60A56EcB47247D92E05447eFd450d6Bf` |
234
- | KYAHook | `0x28e50Aa9eD517E369b2806928709B44062aD9821` |
235
- | ValidationRegistry | `0x6f76cF69B71Dc5F9A414BCEe4583b12738E47985` |
236
- | AgentReputation | `0xe88f3419a2dbac70e3aF6E487b0C63e8301C6A87` |
234
+ | Agether4337Factory | `0x7B23470dCD65b8fEA3Bf49466860b3A55D56268C` |
235
+ | Agether8004ValidationModule | `0xfC6ccFd12e163460C7Ef92d38DC0be6C6cA10f6C` |
236
+ | AgetherHookMultiplexer | `0x094FE93a8b733a97a6945530cA83058CaCbf5278` |
237
+ | Agether7579Bootstrap | `0x62d34D22D379367EEDcb7D1E4dE899A654E982D0` |
238
+ | ValidationRegistry | Not deployed yet |
239
+ | Agether8004Scorer | `0x9f0084E5c941365149c8953133cF062E33a19b8d` |
240
+ | TimelockController | `0x2807912DA2a7278AF883a376bE15bBBf3ab99f52` |
241
+ | Safe Singleton | `0x41675C099F32341bf84BFc5382aF534df5C7461a` |
242
+ | SafeProxyFactory | `0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67` |
243
+ | Safe7579 | `0x7579EE8307284F293B1927136486880611F20002` |
244
+ | EntryPoint v0.7 | `0x0000000071727De22E5E9d8BAf0edAc6f37da032` |
237
245
  | ERC-8004 Identity | `0x8004A169FB4a3325136EB29fA0ceB6D2e539a432` |
238
246
  | Morpho Blue | `0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb` |
239
247
  | USDC | `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913` |
package/src/index.ts CHANGED
@@ -115,7 +115,7 @@ export default function register(api: any) {
115
115
  api.registerTool({
116
116
  name: "agether_register",
117
117
  description:
118
- "Register a new ERC-8004 agent identity on Base and create an AgentAccount. Returns the new agentId.",
118
+ "Register a new ERC-8004 agent identity on Base and create a Safe smart account (via Safe7579). Returns the new agentId.",
119
119
  parameters: {
120
120
  type: "object",
121
121
  properties: {
@@ -164,7 +164,7 @@ export default function register(api: any) {
164
164
  async execute(_id: string, params: { agentId: string }) {
165
165
  try {
166
166
  const cfg = getConfig(api);
167
- // Verify on-chain that this agentId exists and belongs to this wallet
167
+ // Verify onchain that this agentId exists and belongs to this wallet
168
168
  const client = new MorphoClient({
169
169
  privateKey: cfg.privateKey,
170
170
  rpcUrl: cfg.rpcUrl,
@@ -210,9 +210,9 @@ export default function register(api: any) {
210
210
  api.registerTool({
211
211
  name: "agether_set_kya",
212
212
  description:
213
- "Enable or disable KYA verification gate on the KYAHook (owner only). " +
213
+ "Enable or disable KYA verification gate on the ERC8004ValidationModule (owner only). " +
214
214
  "Pass the ValidationRegistry address to enable, or '0x0000000000000000000000000000000000000000' to disable. " +
215
- "Note: the actual transaction must be executed by the owner (TimelockController) targeting the KYAHook contract.",
215
+ "Note: the actual transaction must be executed by the owner (TimelockController) targeting the ERC8004ValidationModule.",
216
216
  parameters: {
217
217
  type: "object",
218
218
  properties: {
@@ -229,7 +229,7 @@ export default function register(api: any) {
229
229
  const cfg = getConfig(api);
230
230
  const client = createClient(cfg);
231
231
 
232
- // Build the calldata for KYAHook.setValidationRegistry — the owner (Timelock) must execute it
232
+ // Build the calldata for ERC8004ValidationModule.setValidationRegistry — the owner (Timelock) must execute it
233
233
  const { ethers } = await import("ethers");
234
234
  const iface = new ethers.Interface([
235
235
  "function setValidationRegistry(address newRegistry)",
@@ -247,12 +247,12 @@ export default function register(api: any) {
247
247
  {
248
248
  action: `${action} KYA gate`,
249
249
  registryAddress: params.registryAddress,
250
- target: "KYAHook contract (not AccountFactory)",
250
+ target: "ERC8004ValidationModule contract",
251
251
  calldata,
252
252
  note:
253
253
  "This calldata must be submitted to the TimelockController by the owner. " +
254
- "Schedule via timelock.schedule(kyaHookAddr, 0, calldata, predecessor, salt, delay). " +
255
- "The target is the KYAHook contract, NOT the AccountFactory.",
254
+ "Schedule via timelock.schedule(validationModuleAddr, 0, calldata, predecessor, salt, delay). " +
255
+ "The target is the ERC8004ValidationModule contract.",
256
256
  },
257
257
  null,
258
258
  2,
@@ -522,7 +522,7 @@ export default function register(api: any) {
522
522
  api.registerTool({
523
523
  name: "agether_score",
524
524
  description:
525
- "Get the agent's current on-chain credit score. " +
525
+ "Get the agent's current onchain credit score. " +
526
526
  "Use 'refresh' param to request a fresh score computation (costs USDC via x402).",
527
527
  parameters: {
528
528
  type: "object",
@@ -552,7 +552,7 @@ export default function register(api: any) {
552
552
  return ok(JSON.stringify(result.data, null, 2));
553
553
  }
554
554
 
555
- // Free: read current on-chain score
555
+ // Free: read current onchain score
556
556
  const { data } = await axios.get(`${cfg.backendUrl}/score/${agentId}/current`);
557
557
  return ok(JSON.stringify(data, null, 2));
558
558
  } catch (e) { return fail(e); }