@aomi-labs/client 0.1.22 → 0.1.24

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aomi-labs/client",
3
- "version": "0.1.22",
3
+ "version": "0.1.24",
4
4
  "description": "Platform-agnostic TypeScript client for the Aomi backend API",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -31,6 +31,7 @@
31
31
  "@getpara/aa-alchemy": "2.21.0",
32
32
  "@getpara/aa-pimlico": "2.21.0",
33
33
  "citty": "^0.2.2",
34
+ "permissionless": "^0.3.5",
34
35
  "viem": "^2.47.11"
35
36
  },
36
37
  "scripts": {
package/skills/README.md CHANGED
@@ -6,7 +6,7 @@ Agent skills for interacting with the [Aomi](https://aomi.dev) on-chain AI trans
6
6
 
7
7
  | Skill | Description |
8
8
  |-------|-------------|
9
- | [aomi-app-builder](aomi-app-builder/SKILL.md) | Build Aomi apps and plugins from APIs, specs, SDK docs, runtime interfaces, and product requirements |
9
+ | [aomi-build](aomi-build/SKILL.md) | Build Aomi apps and plugins from APIs, specs, SDK docs, runtime interfaces, and product requirements |
10
10
  | [aomi-transact](aomi-transact/SKILL.md) | Build and execute EVM transactions through a conversational AI agent via the `aomi` CLI |
11
11
 
12
12
  ## Installation
@@ -33,7 +33,7 @@ npm install -g viem
33
33
 
34
34
  Once installed, ask your agent:
35
35
 
36
- - "What's the price of ETH?"
36
+ - "Use aomi: What's the price of ETH?"
37
37
  - "Swap 1 ETH for USDC on Uniswap"
38
38
  - "Send 0.1 ETH to vitalik.eth"
39
39
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: aomi-app-builder
2
+ name: aomi-build
3
3
  description: >
4
4
  Use when the user wants to build, scaffold, or update an Aomi app/plugin from
5
5
  API docs, OpenAPI or Swagger specs, SDK docs, repository examples, endpoint
@@ -15,7 +15,7 @@ metadata:
15
15
  version: "0.1"
16
16
  ---
17
17
 
18
- # Aomi App Builder
18
+ # Aomi Build
19
19
 
20
20
  Use this skill for tasks like:
21
21
 
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Aomi Build"
3
+ short_description: "Build Aomi apps from APIs and specs"
4
+ default_prompt: "Use $aomi-build to turn this API, OpenAPI spec, or product brief into an Aomi SDK app/plugin with a clean tool surface, preamble, and validation plan."
@@ -0,0 +1,124 @@
1
+ [
2
+ {
3
+ "command": "chat",
4
+ "description": "Send a message to the agent and print the response",
5
+ "args": [{ "name": "message", "required": true, "description": "The message text" }],
6
+ "options": [
7
+ { "name": "--model", "takesValue": true, "description": "Set the session model before sending the message" },
8
+ { "name": "--verbose", "takesValue": false, "description": "Stream agent responses, tool calls, and events live" },
9
+ { "name": "--new-session", "takesValue": false, "description": "Create a fresh active session for this command" },
10
+ { "name": "--app", "takesValue": true, "description": "App name (default: 'default')" },
11
+ { "name": "--chain", "takesValue": true, "description": "Active chain id for chat/session context" },
12
+ { "name": "--public-key", "takesValue": true, "description": "Wallet address so the agent knows your wallet" }
13
+ ]
14
+ },
15
+ {
16
+ "command": "app list",
17
+ "description": "List available apps",
18
+ "options": []
19
+ },
20
+ {
21
+ "command": "app current",
22
+ "description": "Show the current app",
23
+ "options": []
24
+ },
25
+ {
26
+ "command": "model list",
27
+ "description": "List models available to the current backend",
28
+ "options": []
29
+ },
30
+ {
31
+ "command": "model set",
32
+ "description": "Set the active model for the current session",
33
+ "args": [{ "name": "rig", "required": true, "description": "Model identifier" }],
34
+ "options": []
35
+ },
36
+ {
37
+ "command": "chain list",
38
+ "description": "List supported chains",
39
+ "options": []
40
+ },
41
+ {
42
+ "command": "session list",
43
+ "description": "List local sessions with metadata",
44
+ "options": []
45
+ },
46
+ {
47
+ "command": "session new",
48
+ "description": "Start a fresh local/backend session and make it active",
49
+ "options": []
50
+ },
51
+ {
52
+ "command": "session resume",
53
+ "description": "Resume a local session",
54
+ "args": [{ "name": "id", "required": true, "description": "session-id or session-N" }],
55
+ "options": []
56
+ },
57
+ {
58
+ "command": "session delete",
59
+ "description": "Delete a local session file",
60
+ "args": [{ "name": "id", "required": true, "description": "session-id or session-N" }],
61
+ "options": []
62
+ },
63
+ {
64
+ "command": "log",
65
+ "description": "Show full conversation history with tool results",
66
+ "options": []
67
+ },
68
+ {
69
+ "command": "tx",
70
+ "description": "List pending and signed transactions",
71
+ "options": []
72
+ },
73
+ {
74
+ "command": "simulate",
75
+ "description": "Batch-simulate pending transactions atomically (e.g. approve then swap)",
76
+ "args": [{ "name": "tx-id", "required": true, "variadic": true, "description": "One or more pending tx ids" }],
77
+ "options": []
78
+ },
79
+ {
80
+ "command": "sign",
81
+ "description": "Sign and submit a pending transaction",
82
+ "args": [{ "name": "tx-id", "required": true, "variadic": true, "description": "One or more pending tx ids" }],
83
+ "options": [
84
+ { "name": "--eoa", "takesValue": false, "description": "Force EOA signing path" },
85
+ { "name": "--aa", "takesValue": false, "description": "Force AA signing path" },
86
+ { "name": "--aa-provider", "takesValue": true, "description": "AA provider name (AA only)" },
87
+ { "name": "--aa-mode", "takesValue": true, "description": "AA mode (AA only)" },
88
+ { "name": "--rpc-url", "takesValue": true, "description": "Override RPC URL for this signing call" },
89
+ { "name": "--private-key", "takesValue": true, "description": "Hex private key (must start with 0x)" },
90
+ { "name": "--public-key", "takesValue": true, "description": "Wallet address; must match the signer" }
91
+ ]
92
+ },
93
+ {
94
+ "command": "secret list",
95
+ "description": "List configured secrets for the active session",
96
+ "options": []
97
+ },
98
+ {
99
+ "command": "secret add",
100
+ "description": "Add a secret to the active session (NAME=value)",
101
+ "args": [{ "name": "kv", "required": true, "description": "KEY=value pair, e.g. ALCHEMY_API_KEY=..." }],
102
+ "options": []
103
+ },
104
+ {
105
+ "command": "secret clear",
106
+ "description": "Clear all secrets for the active session",
107
+ "options": []
108
+ },
109
+ {
110
+ "command": "status",
111
+ "description": "Show current session state",
112
+ "options": []
113
+ },
114
+ {
115
+ "command": "events",
116
+ "description": "List system events",
117
+ "options": []
118
+ },
119
+ {
120
+ "command": "close",
121
+ "description": "Close the current session",
122
+ "options": []
123
+ }
124
+ ]
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "aomi-transact",
3
+ "target": {
4
+ "surface": "cli",
5
+ "repoPath": "..",
6
+ "skill": "../SKILL.md",
7
+ "discovery": {
8
+ "mode": "manifest"
9
+ },
10
+ "cli": {
11
+ "commands": "./cli-commands.json"
12
+ }
13
+ },
14
+ "benchmark": {
15
+ "apiKeyEnv": "OPENROUTER_API_KEY",
16
+ "format": "pi",
17
+ "timeout": 240000,
18
+ "taskGeneration": {
19
+ "enabled": true,
20
+ "maxTasks": 20,
21
+ "outputDir": "."
22
+ },
23
+ "models": [
24
+ {
25
+ "id": "openrouter/anthropic/claude-sonnet-4-6",
26
+ "name": "Claude Sonnet 4.6",
27
+ "tier": "flagship"
28
+ },
29
+ {
30
+ "id": "openrouter/openai/gpt-4o",
31
+ "name": "Gpt 4o",
32
+ "tier": "mid"
33
+ }
34
+ ],
35
+ "output": {
36
+ "dir": "../benchmark-results"
37
+ },
38
+ "verdict": {
39
+ "perModelFloor": 0.6000000000000001,
40
+ "targetWeightedAverage": 0.8
41
+ }
42
+ },
43
+ "optimize": {
44
+ "model": "openrouter/anthropic/claude-sonnet-4-6",
45
+ "apiKeyEnv": "OPENROUTER_API_KEY",
46
+ "allowedPaths": [
47
+ "SKILL.md"
48
+ ],
49
+ "validation": [],
50
+ "maxIterations": 5
51
+ }
52
+ }
@@ -5,9 +5,10 @@ description: >
5
5
  check balances or prices, build wallet requests, confirm quotes or routes,
6
6
  sign transactions or EIP-712 payloads, switch apps or chains, or execute
7
7
  swaps, transfers, and DeFi actions on-chain. Covers Aomi chat, transaction
8
- review, AA-first signing with mode fallback, persistent AA configuration,
9
- session controls, and per-session secret ingestion.
8
+ review, AA-first signing with mode fallback, session controls, and
9
+ per-session secret ingestion.
10
10
  compatibility: "Requires @aomi-labs/client (`npm install -g @aomi-labs/client`). CLI executable is `aomi`. Requires viem for signing (`npm install viem`). Use AOMI_APP / --app, AOMI_MODEL / --model, AOMI_CHAIN_ID / --chain, CHAIN_RPC_URL / --rpc-url, `aomi secret add` for session secret ingestion, and AOMI_STATE_DIR for local session storage."
11
+
11
12
  license: MIT
12
13
  allowed-tools: Bash
13
14
  metadata:
@@ -25,7 +26,8 @@ backend. Local session data lives under `AOMI_STATE_DIR` or `~/.aomi`.
25
26
 
26
27
  - The user wants to chat with the Aomi agent from the terminal.
27
28
  - The user wants balances, prices, routes, quotes, or transaction status.
28
- - The user wants to build, confirm, sign, or broadcast wallet requests.
29
+ - The user wants to build, simulate, confirm, sign, or broadcast wallet requests.
30
+ - The user wants to simulate a batch of pending transactions before signing.
29
31
  - The user wants to inspect or switch apps, models, chains, or sessions.
30
32
  - The user wants to inject API keys or other backend secrets for the current session.
31
33
  - The user wants to configure or inspect Account Abstraction settings.
@@ -60,7 +62,6 @@ aomi model list|set|current
60
62
  aomi app list|current
61
63
  aomi chain list
62
64
  aomi secret list|clear|add
63
- aomi aa status|set|test|reset
64
65
  ```
65
66
 
66
67
  ## Quick Start
@@ -180,7 +181,7 @@ Run `aomi tx list` to see pending transactions, `aomi tx sign <id>` to sign.
180
181
  Use these rules exactly:
181
182
 
182
183
  - Default command: `aomi tx sign <tx-id> [<tx-id> ...]`
183
- - Default behavior (**auto-detect**): if an AA provider is configured (env vars, `~/.aomi/aa.json`, or flags), use AA automatically. If no AA provider is configured, use EOA. There is no silent fallback — AA either works or fails.
184
+ - Default behavior (**auto-detect**): if an AA provider is configured (env vars or flags), use AA automatically. If no AA provider is configured, use EOA. There is no silent fallback — AA either works or fails.
184
185
  - **Mode fallback**: when AA is used, the CLI tries the preferred mode (default 7702). If it fails, it tries the alternative mode (4337). If both fail, it returns an error suggesting `--eoa`.
185
186
  - `--eoa`: force direct EOA execution, skip AA entirely.
186
187
  - `--aa-provider` or `--aa-mode`: AA-specific controls that also force AA mode. Cannot be used with `--eoa`.
@@ -198,6 +199,87 @@ aomi tx sign tx-1 --eoa --private-key 0xYourPrivateKey --rpc-url https://eth.lla
198
199
  aomi tx sign tx-1 --aa-provider pimlico --aa-mode 4337 --private-key 0xYourPrivateKey
199
200
  ```
200
201
 
202
+ ### Batch Simulation
203
+
204
+ Use `aomi tx simulate` to dry-run pending transactions before signing. Simulation
205
+ runs each tx sequentially on a forked chain so state-dependent flows (approve →
206
+ swap) are validated as a batch — the swap sees the approve's state changes.
207
+
208
+ ```bash
209
+ # Simulate a single pending tx
210
+ aomi tx simulate tx-1
211
+
212
+ # Simulate a multi-step batch in order (approve then swap)
213
+ aomi tx simulate tx-1 tx-2
214
+ ```
215
+
216
+ The response includes per-step success/failure, revert reasons, and gas usage:
217
+
218
+ ```
219
+ Simulation result:
220
+ Batch success: true
221
+ Stateful: true
222
+ Total gas: 147821
223
+
224
+ Step 1 — approve USDC
225
+ success: true
226
+ gas_used: 46000
227
+
228
+ Step 2 — swap on Uniswap
229
+ success: true
230
+ gas_used: 101821
231
+ ```
232
+
233
+ When to simulate:
234
+
235
+ - **Always simulate multi-step flows** (approve → swap, approve → deposit, etc.) before signing. These are state-dependent — the second tx will revert if submitted independently.
236
+ - **Optional for single independent txs** like a simple ETH transfer or a standalone swap with no prior approval needed.
237
+ - If simulation fails at step N, read the revert reason before retrying. Common causes: insufficient balance, expired quote/timestamp, wrong calldata. Do not blindly re-sign after a simulation failure.
238
+
239
+ When not to simulate:
240
+
241
+ - Read-only operations (balances, prices, quotes).
242
+ - If there are no pending transactions (`aomi tx list` shows nothing).
243
+
244
+ Simulation and signing workflow:
245
+
246
+ ```bash
247
+ # 1. Build the request
248
+ aomi chat "approve and swap 100 USDC for ETH on Uniswap" \
249
+ --public-key 0xYourAddress --chain 1
250
+
251
+ # 2. Check what got queued
252
+ aomi tx list
253
+
254
+ # 3. Simulate the batch
255
+ aomi tx simulate tx-1 tx-2
256
+
257
+ # 4. If simulation succeeds, sign
258
+ aomi tx sign tx-1 tx-2 --private-key 0xYourPrivateKey --rpc-url https://eth.llamarpc.com
259
+
260
+ # 5. Verify
261
+ aomi tx list
262
+ ```
263
+
264
+ ### Account Abstraction
265
+
266
+ AA is the preferred signing path when the user wants smart-account behavior,
267
+ gas sponsorship, or the CLI's automated fallback handling.
268
+
269
+ Use AA when:
270
+
271
+ - The user wants the most hands-off signing flow and is fine with the CLI trying AA before EOA.
272
+ - The user wants sponsored or user-funded smart-account execution through Alchemy or Pimlico.
273
+ - The user explicitly asks for `4337` or `7702` account-abstraction mode.
274
+
275
+ How to choose:
276
+
277
+ - `aomi tx sign` with no AA flags: try AA first, then fall back to EOA automatically if AA is unavailable.
278
+ - `aomi tx sign --aa`: require AA only. Use this when the user does not want an EOA fallback.
279
+ - `aomi tx sign --eoa`: bypass AA entirely and sign directly with the wallet key.
280
+ - `aomi tx sign --aa-provider alchemy|pimlico`: force a specific AA provider.
281
+ - `aomi tx sign --aa-mode 4337|7702`: force the execution mode when the user wants a specific AA path.
282
+
201
283
  More signing notes:
202
284
 
203
285
  - `aomi tx sign` handles both transaction requests and EIP-712 typed data signatures.
@@ -285,6 +367,19 @@ aomi secret add NAME=value [NAME=value ...]
285
367
  - `aomi secret clear` removes all configured secrets for the active session.
286
368
  - `aomi secret add` ingests one or more NAME=value secrets.
287
369
 
370
+ ### Batch Simulation
371
+
372
+ ```bash
373
+ aomi tx simulate <tx-id> [<tx-id> ...]
374
+ ```
375
+
376
+ - Runs pending transactions sequentially on a forked chain (Anvil snapshot/revert).
377
+ - Each tx sees state changes from previous txs — validates state-dependent flows like approve → swap.
378
+ - Returns per-step success/failure, revert reasons, and `gas_used`.
379
+ - Returns `total_gas` for the entire batch.
380
+ - No on-chain state is modified — the fork is reverted after simulation.
381
+ - Requires pending transactions to exist in the session (`aomi tx list` to check).
382
+
288
383
  ### App And Model Commands
289
384
 
290
385
  ```bash
@@ -371,52 +466,35 @@ When using AA, the CLI tries modes in order:
371
466
  2. If preferred mode fails, try the alternative mode (7702 ↔ 4337).
372
467
  3. If both modes fail, return error with suggestion: use `--eoa` to sign without AA.
373
468
 
374
- ### Persistent AA Configuration
375
-
376
- AA settings can be persisted to `~/.aomi/aa.json` using the `aomi aa` commands,
377
- eliminating the need to pass env vars or flags on every sign.
378
-
379
- ```bash
380
- # Configure AA provider and credentials
381
- aomi aa set provider alchemy
382
- aomi aa set key <your-alchemy-key>
383
- aomi aa set alchemy-key <your-alchemy-key> # provider-specific key
384
- aomi aa set pimlico-key <your-pimlico-key> # provider-specific key
385
- aomi aa set policy <gas-policy-id>
386
- aomi aa set mode 7702
387
- aomi aa set fallback eoa
388
-
389
- # View resolved config (all layers merged)
390
- aomi aa status
391
-
392
- # Validate setup against a chain
393
- aomi aa test --chain 8453
469
+ ### AA Configuration
394
470
 
395
- # Clear all persisted config
396
- aomi aa reset
397
- ```
471
+ AA is configured per-invocation via flags or environment variables. There is
472
+ no persistent AA config file — export the relevant env vars in your shell, or
473
+ pass `--aa-*` flags directly on `aomi tx sign`.
398
474
 
399
- Priority chain for AA resolution: **flag > env var > `~/.aomi/aa.json` > defaults**.
475
+ Priority chain for AA resolution: **flag > env var > defaults**.
400
476
 
401
477
  ### AA Providers
402
478
 
403
- | Provider | Flag | Env Var | Persistent Config | Notes |
404
- | -------- | ----------------------- | ----------------- | ------------------------- | -------------------------------- |
405
- | Alchemy | `--aa-provider alchemy` | `ALCHEMY_API_KEY` | `aomi aa set provider alchemy` | Supports sponsorship, 4337, 7702 |
406
- | Pimlico | `--aa-provider pimlico` | `PIMLICO_API_KEY` | `aomi aa set provider pimlico` | Supports 4337 and 7702 |
479
+ | Provider | Flag | Env Var | Notes |
480
+ | -------- | ----------------------- | ----------------- | -------------------------------- |
481
+ | Alchemy | `--aa-provider alchemy` | `ALCHEMY_API_KEY` | 4337 (sponsored via gas policy), 7702 (EOA pays gas) |
482
+ | Pimlico | `--aa-provider pimlico` | `PIMLICO_API_KEY` | 4337 (sponsored via dashboard policy). Direct private key supported. |
407
483
 
408
484
  Provider selection rules:
409
485
 
410
- - If the user explicitly selects a provider (flag or persistent config), use it.
411
- - In auto-detect mode, the CLI uses the first configured AA provider.
486
+ - If the user explicitly selects a provider via flag, use it.
487
+ - In auto-detect mode, the CLI uses the first configured AA provider (whichever env var is set).
412
488
  - If no AA provider is configured, auto-detect uses EOA directly.
413
489
 
414
490
  ### AA Modes
415
491
 
416
- | Mode | Flag | Meaning |
417
- | ------ | ---------------- | -------------------------------- |
418
- | `4337` | `--aa-mode 4337` | Bundler-based smart account flow |
419
- | `7702` | `--aa-mode 7702` | Delegated execution flow |
492
+ | Mode | Flag | Meaning | Gas |
493
+ | ------ | ---------------- | -------------------------------- | --- |
494
+ | `4337` | `--aa-mode 4337` | Bundler + paymaster UserOperation via smart account. Gas sponsored by paymaster. | Paymaster pays |
495
+ | `7702` | `--aa-mode 7702` | Native EIP-7702 type-4 transaction with delegation. EOA signs authorization + sends tx to self. | EOA pays |
496
+
497
+ Important: **7702 requires the signing EOA to have native gas tokens** (ETH, MATIC, etc.). There is no paymaster/sponsorship for 7702. Use 4337 for gasless execution.
420
498
 
421
499
  ### Default Chain Modes
422
500
 
@@ -430,7 +508,9 @@ Provider selection rules:
430
508
 
431
509
  ### Sponsorship
432
510
 
433
- Alchemy sponsorship is optional.
511
+ Sponsorship is available for **4337 mode only**. 7702 does not support sponsorship.
512
+
513
+ **Alchemy** (optional gas policy):
434
514
 
435
515
  ```bash
436
516
  export ALCHEMY_API_KEY=your-key
@@ -438,15 +518,15 @@ export ALCHEMY_GAS_POLICY_ID=your-policy-id
438
518
  aomi tx sign tx-1
439
519
  ```
440
520
 
441
- Or use persistent config:
521
+ **Pimlico** (sponsorship via dashboard policy):
442
522
 
443
523
  ```bash
444
- aomi aa set provider alchemy
445
- aomi aa set key your-key
446
- aomi aa set policy your-policy-id
447
- aomi tx sign tx-1
524
+ export PIMLICO_API_KEY=your-key
525
+ aomi tx sign tx-1 --aa-provider pimlico --aa-mode 4337
448
526
  ```
449
527
 
528
+ Pimlico sponsorship is configured on the Pimlico dashboard (sponsorship policies). The API key automatically picks up the active policy — no separate policy ID env var needed.
529
+
450
530
  ### Supported Chains
451
531
 
452
532
  | Chain | ID |
@@ -480,28 +560,30 @@ Practical rule:
480
560
  ### Flags And Env Vars
481
561
 
482
562
  All config can be passed as flags. Flags override environment variables.
483
- Environment variables override persistent config (`~/.aomi/aa.json`).
484
-
485
- | Flag | Env Var | Default | Purpose |
486
- | --------------- | ------------------ | ---------------------- | --------------------------------------- |
487
- | `--backend-url` | `AOMI_BACKEND_URL` | `https://api.aomi.dev` | Backend URL |
488
- | `--api-key` | `AOMI_API_KEY` | none | API key for non-default apps |
489
- | `--app` | `AOMI_APP` | `default` | Backend app |
490
- | `--model` | `AOMI_MODEL` | backend default | Session model |
491
- | `--public-key` | `AOMI_PUBLIC_KEY` | none | Wallet address for chat/session context |
492
- | `--private-key` | `PRIVATE_KEY` | none | Signing key for `aomi tx sign` |
493
- | `--rpc-url` | `CHAIN_RPC_URL` | chain RPC default | RPC override for signing |
494
- | `--chain` | `AOMI_CHAIN_ID` | `1` | Active wallet chain |
495
- | `--aa-provider` | `AOMI_AA_PROVIDER` | auto-detect | AA provider override |
496
- | `--aa-mode` | `AOMI_AA_MODE` | chain default | AA mode override |
563
+
564
+ | Flag | Env Var | Default | Purpose |
565
+ | --------------- | ------------------ | ---------------------- | --------------------------------------------------------- |
566
+ | `--backend-url` | `AOMI_BACKEND_URL` | `https://api.aomi.dev` | Backend URL |
567
+ | `--api-key` | `AOMI_API_KEY` | none | API key for non-default apps |
568
+ | `--app` | `AOMI_APP` | `default` | Backend app |
569
+ | `--model` | `AOMI_MODEL` | backend default | Session model |
570
+ | `--new-session` | | off | Create a fresh active session for this command |
571
+ | `--public-key` | `AOMI_PUBLIC_KEY` | none | Wallet address for chat/session context |
572
+ | `--private-key` | `PRIVATE_KEY` | none | Signing key for `aomi tx sign` |
573
+ | `--rpc-url` | `CHAIN_RPC_URL` | chain RPC default | RPC override for signing |
574
+ | `--chain` | `AOMI_CHAIN_ID` | none | Active wallet chain (inherits session chain if unset) |
575
+ | `--eoa` | | off | Force plain EOA, skip AA even if configured (sign-only) |
576
+ | `--aa` | | off | Force AA, error if provider not configured (sign-only) |
577
+ | `--aa-provider` | `AOMI_AA_PROVIDER` | auto-detect | AA provider override: `alchemy` \| `pimlico` (sign-only) |
578
+ | `--aa-mode` | `AOMI_AA_MODE` | chain default | AA mode override: `4337` \| `7702` (sign-only) |
497
579
 
498
580
  ### AA Provider Credentials
499
581
 
500
582
  | Env Var | Purpose |
501
583
  | ------------------------ | ----------------------------------- |
502
- | `ALCHEMY_API_KEY` | Enables Alchemy AA |
503
- | `ALCHEMY_GAS_POLICY_ID` | Optional Alchemy sponsorship policy |
504
- | `PIMLICO_API_KEY` | Enables Pimlico AA |
584
+ | `ALCHEMY_API_KEY` | Enables Alchemy AA (4337 + 7702) |
585
+ | `ALCHEMY_GAS_POLICY_ID` | Optional Alchemy sponsorship policy (4337 only) |
586
+ | `PIMLICO_API_KEY` | Enables Pimlico AA (4337 sponsored) |
505
587
 
506
588
  `ALCHEMY_API_KEY` can also be used to construct chain-specific signing RPCs:
507
589
 
@@ -525,7 +607,8 @@ Storage layout by default:
525
607
 
526
608
  - `~/.aomi/sessions/` stores per-session JSON files.
527
609
  - `~/.aomi/active-session.txt` stores the active local session pointer.
528
- - `~/.aomi/aa.json` stores persistent AA configuration.
610
+
611
+ AA configuration is supplied per-invocation via flags or environment variables (no persistent `aa.json` file).
529
612
 
530
613
  ### Important Config Rules
531
614
 
@@ -569,6 +652,28 @@ aomi tx list
569
652
  aomi session log
570
653
  ```
571
654
 
655
+ ### Approve + Swap With Simulation
656
+
657
+ ```bash
658
+ # 1. Build a multi-step request
659
+ aomi chat "approve and swap 500 USDC for ETH on Uniswap" \
660
+ --public-key 0xYourAddress --chain 1
661
+
662
+ # 2. Check queued requests
663
+ aomi tx list
664
+
665
+ # 3. Simulate the batch — approve then swap
666
+ aomi tx simulate tx-1 tx-2
667
+
668
+ # 4. If simulation passes, sign the batch
669
+ aomi tx sign tx-1 tx-2 \
670
+ --private-key 0xYourPrivateKey \
671
+ --rpc-url https://eth.llamarpc.com
672
+
673
+ # 5. Verify
674
+ aomi tx list
675
+ ```
676
+
572
677
  ### Explicit EOA Flow
573
678
 
574
679
  ```bash
@@ -587,16 +692,14 @@ aomi tx sign tx-1 \
587
692
  --private-key 0xYourPrivateKey
588
693
  ```
589
694
 
590
- ### AA Setup With Persistent Config
695
+ ### AA Setup With Environment Variables
591
696
 
592
697
  ```bash
593
- # One-time setup
594
- aomi aa set provider alchemy
595
- aomi aa set key your-alchemy-key
596
- aomi aa set policy your-gas-policy-id
597
- aomi aa status
698
+ # Export once per shell — auto-detected by `aomi tx sign`
699
+ export ALCHEMY_API_KEY=your-alchemy-key
700
+ export ALCHEMY_GAS_POLICY_ID=your-gas-policy-id
598
701
 
599
- # Now all signs auto-use AA — no flags needed
702
+ # All subsequent signs auto-use AA — no flags needed
600
703
  aomi tx sign tx-1 --private-key 0xYourPrivateKey
601
704
  ```
602
705
 
@@ -663,9 +766,10 @@ aomi session close
663
766
 
664
767
  - If `aomi chat` returns `(no response)`, wait briefly and run `aomi session status`.
665
768
  - If AA signing fails, the CLI tries the alternative AA mode automatically. If both modes fail, it returns an error suggesting `--eoa`. Read the console output before retrying manually.
666
- - If AA is required and fails, check `ALCHEMY_API_KEY` or `PIMLICO_API_KEY`, the selected chain, and any requested `--aa-mode`. Use `aomi aa status` to see the resolved AA config.
769
+ - If AA is required and fails, check `ALCHEMY_API_KEY` or `PIMLICO_API_KEY`, the selected chain, and any requested `--aa-mode`.
667
770
  - If a transaction fails on-chain, check the RPC URL, balance, and chain.
668
771
  - `401`, `429`, and generic parameter errors during `aomi tx sign` are often RPC problems rather than transaction-construction problems. Try a reliable RPC for the correct chain.
669
772
  - If `ALCHEMY_API_KEY` is set, construct the correct chain-specific Alchemy RPC before falling back to random public endpoints.
670
773
  - If one or two public RPCs fail for the same chain, stop rotating through random endpoints and ask the user for a proper RPC URL for that chain.
671
- - Use `aomi aa test --chain <id>` to validate AA setup for a specific chain before signing.
774
+ - If `aomi tx simulate` fails with a revert, read the revert reason. Common causes: expired quote or timestamp (re-chat to get a fresh quote), insufficient token balance, or missing prior approval. Do not sign transactions that failed simulation without understanding why.
775
+ - If `aomi tx simulate` returns `stateful: false`, the backend could not fork the chain — simulation ran each tx independently via `eth_call`, so state-dependent flows (approve → swap) may show false negatives. Retry or check that the backend's Anvil instance is running.
@@ -1,4 +0,0 @@
1
- interface:
2
- display_name: "Aomi App Builder"
3
- short_description: "Build Aomi apps from APIs and specs"
4
- default_prompt: "Use $aomi-app-builder to turn this API, OpenAPI spec, or product brief into an Aomi SDK app/plugin with a clean tool surface, preamble, and validation plan."