agentlili 0.1.0 → 0.1.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.
Files changed (49) hide show
  1. package/README.md +74 -171
  2. package/dist/agent-7OQQFXF5.js +51 -0
  3. package/dist/agent-7OQQFXF5.js.map +1 -0
  4. package/dist/chat-bindings-RYWDO7CX.js +111 -0
  5. package/dist/chat-bindings-RYWDO7CX.js.map +1 -0
  6. package/dist/chat-bindings-UZ7XOFUP.js +112 -0
  7. package/dist/chat-bindings-UZ7XOFUP.js.map +1 -0
  8. package/dist/chunk-4MDHY5JF.js +845 -0
  9. package/dist/chunk-4MDHY5JF.js.map +1 -0
  10. package/dist/chunk-4XE7BRB2.js +158 -0
  11. package/dist/chunk-4XE7BRB2.js.map +1 -0
  12. package/dist/chunk-AJUEDFT6.js +4739 -0
  13. package/dist/chunk-AJUEDFT6.js.map +1 -0
  14. package/dist/chunk-LODRFUX3.js +1236 -0
  15. package/dist/chunk-LODRFUX3.js.map +1 -0
  16. package/dist/chunk-MAYEOV77.js +298 -0
  17. package/dist/chunk-MAYEOV77.js.map +1 -0
  18. package/dist/chunk-R7JN32HS.js +156 -0
  19. package/dist/chunk-R7JN32HS.js.map +1 -0
  20. package/dist/cli.js +5013 -410
  21. package/dist/cli.js.map +1 -1
  22. package/dist/db-2WGQUOIQ.js +8 -0
  23. package/dist/db-2WGQUOIQ.js.map +1 -0
  24. package/dist/db-43J2JIFG.js +7 -0
  25. package/dist/db-43J2JIFG.js.map +1 -0
  26. package/dist/format-2LMWSOJJ.js +61 -0
  27. package/dist/format-2LMWSOJJ.js.map +1 -0
  28. package/dist/format-AAX7AYYW.js +59 -0
  29. package/dist/format-AAX7AYYW.js.map +1 -0
  30. package/dist/logger-RRH3ZNME.js +14 -0
  31. package/dist/logger-RRH3ZNME.js.map +1 -0
  32. package/dist/logs-ui-IVYKG4OW.js +123 -0
  33. package/dist/logs-ui-IVYKG4OW.js.map +1 -0
  34. package/dist/mcp-server.js +571 -842
  35. package/dist/mcp-server.js.map +1 -1
  36. package/dist/sdk.d.ts +5318 -0
  37. package/dist/sdk.js +5654 -0
  38. package/dist/sdk.js.map +1 -0
  39. package/dist/telegram-sender-R46BUP37.js +26 -0
  40. package/dist/telegram-sender-R46BUP37.js.map +1 -0
  41. package/dist/telegram-sender-RFPZ35UU.js +28 -0
  42. package/dist/telegram-sender-RFPZ35UU.js.map +1 -0
  43. package/dist/vault-client-F3RLRPZM.js +20 -0
  44. package/dist/vault-client-F3RLRPZM.js.map +1 -0
  45. package/dist/wallet-LLSIZWGR.js +8 -0
  46. package/dist/wallet-LLSIZWGR.js.map +1 -0
  47. package/package.json +41 -14
  48. package/dist/chunk-AAYS2L5P.js +0 -946
  49. package/dist/chunk-AAYS2L5P.js.map +0 -1
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # AI Agent Wallet — Solana Devnet
2
2
 
3
- An autonomous AI agent wallet for Solana that manages wallets, executes DeFi operations, and interacts with on-chain protocols — all through natural language. Supports multiple independent agents, each with their own isolated keypair, security policy, and decision-making context.
3
+ An autonomous AI agent wallet for Solana that manages wallets, executes DeFi operations, and interacts with on-chain protocols — all through natural language. Secured by Turnkey hardware-backed key custody, on-chain PDA vault policy enforcement, and Kora gasless transactions. Supports multiple independent agents, each with their own isolated wallet, security policy, and decision-making context.
4
4
 
5
- Built with Vercel AI SDK, Solana Agent Kit v2, and Next.js 15.
5
+ Built with Vercel AI SDK, Solana Agent Kit v2, Next.js 15, and Turnkey secure enclave.
6
6
 
7
7
  ---
8
8
 
@@ -10,16 +10,16 @@ Built with Vercel AI SDK, Solana Agent Kit v2, and Next.js 15.
10
10
 
11
11
  | Judging Criteria | What to Look At | Command / Link |
12
12
  |---|---|---|
13
- | **C1: Functional Demo** | Autonomous DeFi agent with 93 tools, SSE activity feed, one-click demos | `pnpm dev` → click any demo card, or `SKIP_LLM=1 pnpm headless-demo` |
14
- | **C2: Security & Key Mgmt** | FROST 2-of-3 threshold signing, PolicyParticipant, PDA vault, spending limits, HMAC audit chain | `pnpm frost-demo` (no API keys needed), Security tab in UI, [SECURITY.md](SECURITY.md) |
15
- | **C3: Documentation** | 1,800+ line deep dive, 22 Mermaid diagrams, machine-readable SKILLS.md | [DEEP_DIVE.md](DEEP_DIVE.md) (architecture + threat model), [SKILLS.md](SKILLS.md) |
16
- | **C4: Multi-Agent Scalability** | 12-agent stress test, fleet health dashboard, bulk provisioning | `pnpm stress-test` (12 agents, 76 ops, 0% errors) |
13
+ | **C1: Functional Demo** | Autonomous DeFi agent with 93 tools, SSE activity feed, one-click demos | `pnpm dev` → Dashboard |
14
+ | **C2: Security & Key Mgmt** | Turnkey secure enclave, PDA vault, Kora gasless, spending limits, HMAC audit chain | Security tab in UI, [Security & Threat Model](../resources/docs/00-overview.md#threat-model-summary) |
15
+ | **C3: Documentation** | 11-chapter deep dive, Mermaid diagrams, machine-readable SKILLS.md | [Documentation set](../resources/docs/00-overview.md) (architecture + threat model), [SKILLS.md](SKILLS.md) |
16
+ | **C4: Multi-Agent Scalability** | Fleet health dashboard, bulk provisioning, agent-to-agent transfers | `pnpm dev` Agent Monitor tab |
17
17
 
18
18
  ### Key Differentiators
19
- - **1,106 passing tests** (zero-mock) — run `pnpm test` to verify
20
- - **18-tool MCP server** for Claude Desktop integration — `pnpm mcp`
21
- - **5-layer security**: FROST threshold PolicyParticipant → PDA vault → Kora gasless → Jito MEV protection
22
- - **93 DeFi tools** via Solana Agent Kit v2 (vs typical 24)
19
+ - **Comprehensive test suite** — run `pnpm test` to verify
20
+ - **MCP server** for Claude Desktop integration — `pnpm mcp`
21
+ - **3-layer security**: Turnkey secure enclave → PDA vault → Kora gasless
22
+ - **93 DeFi tools** via Solana Agent Kit v2 (vs typical 2-4)
23
23
 
24
24
  ---
25
25
 
@@ -29,8 +29,8 @@ Built with Vercel AI SDK, Solana Agent Kit v2, and Next.js 15.
29
29
  ┌─────────────────────────────────────────────────────────────────────────┐
30
30
  │ WEB UI (Next.js) │
31
31
  │ Chat Interface │ Wallet Panel │ Portfolio │ Agent Monitor │ Analytics │
32
- │ Activity Feed │ Demo Launcher │ Strategy │ Backup │ Lifecycle
33
- │ Security Tab: FROST Mgmt │ Audit Log Viewer │ Fleet Health │ Spending │
32
+ │ Activity Feed │ Demo Launcher │ Backup │ Lifecycle
33
+ │ Security Tab: Vault Mgmt │ Audit Log Viewer │ Fleet Health │ Spending │
34
34
  └───────────────────────────────────┬─────────────────────────────────────┘
35
35
  │ HTTP + SSE
36
36
  ┌───────────────────────────────────▼─────────────────────────────────────┐
@@ -43,14 +43,14 @@ Built with Vercel AI SDK, Solana Agent Kit v2, and Next.js 15.
43
43
  │ AGENT CORE │
44
44
  │ LLM Provider (Claude / GPT-4) Solana Agent Kit v2 (93 DeFi Tools) │
45
45
  │ Multi-step Tool Chaining Success Detection Pipeline │
46
- Strategy Presets (3 risk levels) Per-Agent SSE Event Bus
46
+ │ Per-Agent SSE Event Bus Scheduled & Recurring Payments
47
47
  └───────────────────────────────────┬─────────────────────────────────────┘
48
48
 
49
49
  ┌───────────────────────────────────▼─────────────────────────────────────┐
50
50
  │ WALLET LAYER │
51
- WalletManager: AES-256-GCM + scrypt KDF
52
- KeypairWallet: Ed25519 signing, devnet airdrop, SPL token support
53
- Isolated per-agent state: keypair, tx log, spending ledger, lifecycle
51
+ Turnkey Secure Enclave: hardware-backed key custody (no keys in memory)
52
+ BIP-32 HD wallet: per-agent sub-accounts at m/44'/501'/{index}'/0'
53
+ PDA Vault: on-chain spending limits, program allowlists, cooldowns
54
54
  └──────────────────┬────────────────────────────────┬─────────────────────┘
55
55
  │ direct SOL fees │ gasless (Kora)
56
56
  │ │
@@ -70,8 +70,6 @@ Built with Vercel AI SDK, Solana Agent Kit v2, and Next.js 15.
70
70
 
71
71
  ## Quick Start (Under 3 Minutes)
72
72
 
73
- > **No API key?** Skip to the [Headless Demo](#headless-demo-no-browser-required) below — runs the full wallet + FROST demo without any external keys.
74
-
75
73
  ### Prerequisites
76
74
 
77
75
  - Node.js 18+
@@ -93,7 +91,11 @@ node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
93
91
  # 4. Add your LLM API key to .env (optional — headless demo works without it)
94
92
  # ANTHROPIC_API_KEY=sk-ant-api03-{your-key-here}
95
93
 
96
- # 5. Start the web app
94
+ # 5. (Optional) Set a scheduler secret for the /api/cron/tick endpoint
95
+ # CRON_SECRET=$(node -e "console.log(require('crypto').randomBytes(32).toString('hex'))")
96
+ # CRON_JOB_API_KEY=your-cron-job-org-api-key # For webhook automations
97
+
98
+ # 6. Start the web app
97
99
  pnpm dev
98
100
  ```
99
101
 
@@ -108,19 +110,6 @@ Once the app is running:
108
110
  3. Watch the **Activity Feed** (bottom of page) stream live tool calls and transaction signatures in real time
109
111
  4. Click any transaction signature → opens directly in **Solana Explorer** on devnet (every TX is a clickable link to the explorer)
110
112
 
111
- ### Headless Demo (No Browser Required)
112
-
113
- ```bash
114
- # Wallet + airdrop + on-chain verify — NO API key needed
115
- SKIP_LLM=1 pnpm headless-demo
116
-
117
- # FROST threshold signing demo — NO API key needed
118
- pnpm frost-demo
119
-
120
- # Full 7-phase demo with autonomous LLM execution (requires ANTHROPIC_API_KEY)
121
- pnpm headless-demo
122
- ```
123
-
124
113
  ### Gasless Transactions (Optional — Kora Paymaster)
125
114
 
126
115
  To enable gasless transactions where agents don't need SOL for fees:
@@ -136,13 +125,6 @@ KORA_FEE_MODE=sponsored
136
125
 
137
126
  See [kora_server/README.md](../kora_server/README.md) for full setup details.
138
127
 
139
- ### Multi-Agent Scalability Test
140
-
141
- ```bash
142
- pnpm stress-test # 12 concurrent agents, 76 ops, 0% errors — empirical proof
143
- STRESS_AGENTS=20 pnpm stress-test # Scale to 20 agents
144
- ```
145
-
146
128
  ### CLI Mode
147
129
 
148
130
  ```bash
@@ -155,47 +137,43 @@ pnpm cli
155
137
 
156
138
  ### Autonomous Agent Wallet (C1)
157
139
 
158
- - **Programmatic wallet creation** — `Keypair.generate()` with automatic devnet airdrop on creation
159
- - **AES-256-GCM encrypted key storage** — per-wallet scrypt salt, stored at rest on disk
140
+ - **Turnkey-backed wallet creation** — BIP-32 HD sub-accounts derived from user's Turnkey wallet, hardware-backed key custody
141
+ - **No keys in memory** — private keys never leave the Turnkey secure enclave; signing happens server-side via Turnkey API
160
142
  - **Automatic transaction signing** — no human approval required; agent signs and submits
161
143
  - **93 DeFi tools** via Solana Agent Kit v2 (TokenPlugin + DefiPlugin)
162
144
  - **Multi-step tool chaining** — up to 10 sequential tool calls per LLM request
163
145
  - **Natural language → on-chain execution** — "swap 0.1 SOL for USDC" → Jupiter swap tx
164
146
  - **Real-time SSE activity feed** — live streaming of every tool call, tx signature, and balance change as they happen
165
- - **One-click demo mode** — 3 pre-built autonomous DeFi scenarios; spawns wallet, funds it, and executes strategy while you watch
147
+ - **Scheduled & recurring payments** — schedule future SOL transfers or set up daily/weekly/monthly recurring payments, all persisted to DB and auto-executed by the scheduler
148
+ - **One-click demo mode** — 3 pre-built autonomous DeFi scenarios; spawns wallet, funds it, and executes while you watch
166
149
  - **Portfolio view** — aggregate SOL + SPL holdings across all agent wallets with USD values (Jupiter Price API)
167
150
  - **Transaction analytics dashboard** — success/failure rates, SOL spent, tool usage charts, hourly timeline
168
- - **Security tab** — dedicated sidebar panel with FROST wallet management, HMAC-chained audit log viewer with integrity verification, fleet health dashboard (grade distribution, agents needing attention), and per-wallet spending limits editor
151
+ - **Security tab** — dedicated sidebar panel with vault management, HMAC-chained audit log viewer with integrity verification, fleet health dashboard (grade distribution, agents needing attention), and per-wallet spending limits editor
169
152
 
170
153
  ### Security & Key Management (C2)
171
154
 
172
- - **AES-256-GCM encryption** all private keys encrypted at rest; GCM auth tag detects ciphertext tampering
173
- - **scrypt key derivation** — N=2^14 storage, N=2^17 backup; memory-hard against brute force
155
+ **3-layer defense-in-depth: Turnkey secure enclave PDA vault Kora gasless**
156
+
157
+ - **Turnkey secure enclave** — hardware-backed key custody; private keys never leave the enclave, never exist in application memory. One HD wallet per user, BIP-32 sub-accounts per agent at `m/44'/501'/{unixSeconds}'/0'`
158
+ - **PDA vault (on-chain)** — Anchor program at `Bm2NAhhpw1iopQqba8ywXi9NH27EmyyV62wddDfpjMoF` enforces spending limits, program allowlists, and cooldowns at the Solana runtime level. Seeds: `[b"vault", agent_pubkey]`
159
+ - **Kora gasless transactions** — paymaster co-signing; agents transact without holding SOL for fees. Fee payer separation means agent keys never touch gas funds. Supports sponsored (free), margin, and fixed token fee modes. See `kora_server/` for local setup
174
160
  - **HMAC-SHA256 request signing** — every write/delete request signed with a derived key; replays blocked via 5-minute window
175
161
  - **Per-IP sliding-window rate limiting** — 12 per-bucket presets; prevents API abuse and DoS
176
162
  - **Spending limits** — configurable max SOL per-transaction and per-day per agent; blocks over-budget tool calls
177
163
  - **HMAC-chained audit log** — append-only JSONL with each entry hashing the previous; tamper detection via `verifyAuditIntegrity()`
178
- - **Password-protected wallet backup** — export encrypted JSON, restore from file; scrypt N=2^17 for strong backup protection
179
164
  - **Agent lifecycle enforcement** — paused/terminated agents are blocked from executing at the API level (403 AGENT_NOT_ACTIVE)
180
165
  - **Input sanitization** — HTML/XSS stripped from labels, wallet IDs validated by strict hex regex, JSON parse errors handled gracefully
181
- - **FROST threshold signing (RFC 9591)** — 2-of-3 Ed25519 threshold signatures; no single key compromise can sign
182
- - **PolicyParticipant enforcement** — 5 independent checks (program allowlist, per-tx/daily limits, intent matching, suspicious patterns, cooldown)
183
- - **Proactive share refresh** — rotate key shares without changing on-chain address; forward secrecy
184
- - **PDA Vault (on-chain)** — Anchor program enforces spending limits and program allowlists at the Solana runtime level
185
166
  - **Jito MEV protection** — bundle submission bypasses public mempool to prevent sandwich attacks (mainnet-beta only; devnet transactions use standard RPC submission)
186
- - **Kora gasless transactions** — optional paymaster co-signing; agents transact without holding SOL for fees. Supports sponsored (free), margin, and fixed token fee modes. See `kora_server/` for local setup.
167
+ - **Agent isolation** — separate wallet sub-account, RPC context, tx log, spending ledger, lifecycle state per agent
187
168
 
188
169
  ### Documentation & Deep Dive (C3)
189
170
 
190
- - [DEEP_DIVE.md](./DEEP_DIVE.md) — 1,700+ line architecture deep dive with 22 Mermaid diagrams (17 sections):
191
- - System overview, separation of concerns, multi-agent isolation, key management flow
192
- - Transaction signing sequence, HMAC authentication flow, wallet backup pipeline
193
- - Agent lifecycle state machine, real-time event architecture, threat model visualization
194
- - Section 12: FROST threshold signing architecture | Section 13: Threat model progression
195
- - Section 14: Why this is a spending account | Section 15: Prompt injection defense
196
- - Section 16: Transaction lifecycle (CU simulation, commitment strategy, retry)
197
- - **Section 17: Full system architecture — the 5-layer defense-in-depth synthesizing argument**
198
- - [SECURITY.md](./SECURITY.md) — Full STRIDE threat model, 12 mitigated threats (T1–T12), 5 accepted risks, cryptographic inventory table, attack surface map, production hardening roadmap
171
+ - [Documentation set](../resources/docs/00-overview.md) — 11-chapter architecture deep dive covering:
172
+ - Wallet architecture & adapter pattern, cryptographic internals (Argon2id + scrypt KDFs)
173
+ - Agent reasoning, multi-step tool chaining, 8-scope spend guard layer
174
+ - PDA vault on-chain enforcement, Turnkey HSM integration, threat model
175
+ - CLI reference, MCP/AI tools integration, Studio dashboard
176
+ - Agent evolution (audit trails, memory, self-reflection), Kora gasless transactions
199
177
  - [BENCHMARK.md](./BENCHMARK.md) — Stress test results: 12 concurrent agents, 76 ops, **0% error rate**, 1.8s total, wallet isolation proof, memory profile, extrapolation to 100+ agents
200
178
  - [SKILLS.md](./SKILLS.md) — Complete agent capability catalog (93 tools across 11 categories) for judges/agents to read
201
179
  - [VIDEO_SCRIPT.md](./VIDEO_SCRIPT.md) — Structured 7-scene, 5-minute demo recording script
@@ -203,18 +181,15 @@ pnpm cli
203
181
 
204
182
  ### Multi-Agent Scalability (C4)
205
183
 
206
- - **Independent wallet isolation** — each agent has its own keypair, RPC context, tx log, spending ledger, strategy config, and lifecycle state; cryptographically verified (see [BENCHMARK.md](./BENCHMARK.md))
184
+ - **Independent wallet isolation** — each agent has its own keypair, RPC context, tx log, spending ledger, and lifecycle state; cryptographically verified (see [BENCHMARK.md](./BENCHMARK.md))
207
185
  - **Agent monitoring dashboard** — live view of all agents: balance, status (idle/executing/error/paused/terminated), last action, daily spending bar, success rate
208
186
  - **Agent lifecycle management** — pause, resume, or terminate agents with proper cleanup; terminated is terminal; transition history persisted
209
187
  - **Agent-to-agent transfers** — one agent can send SOL or SPL tokens to another agent's wallet; lifecycle and spending checks enforced
210
- - **Strategy presets** — conservative / balanced / aggressive risk profiles; affects slippage, max position size, leverage rules, protocol selection
211
- - **Stress test** — `pnpm stress-test` spawns 12 concurrent agents, runs 7 phases (create, airdrop, balance, transfers, lifecycle, strategy, monitoring); **76 ops / 0 failures / 1.8s** on Solana devnet; see [BENCHMARK.md](./BENCHMARK.md) for full results
212
-
213
188
  ### UI/UX Polish
214
189
 
215
190
  - **Dark/light theme toggle** — CSS variable system with localStorage persistence, FOUC-free SSR
216
191
  - **Loading skeletons** — shimmer placeholders for wallet panel, portfolio, agent monitor, analytics
217
- - **Toast notifications** — success/error/info toasts for every user action (wallet create, airdrop, strategy change, backup, transfer, lifecycle transition)
192
+ - **Toast notifications** — success/error/info toasts for every user action (wallet create, airdrop, backup, transfer, lifecycle transition)
218
193
  - **Copy-to-clipboard** — animated clipboard → checkmark for wallet addresses, tx signatures, mint addresses
219
194
  - **Solana Explorer deep links** — every tx signature and wallet address links to Solana Explorer with correct cluster
220
195
  - **Mobile responsive layout** — tested on iOS (safe area insets, `h-dvh`, 16px input zoom prevention)
@@ -234,10 +209,10 @@ WALLET_ENCRYPTION_KEY=<key> pnpm mcp
234
209
  ```json
235
210
  {
236
211
  "mcpServers": {
237
- "stng-defi": {
212
+ "agentlili": {
238
213
  "command": "npx",
239
214
  "args": ["tsx", "src/mcp/server.ts"],
240
- "cwd": "/path/to/stng_defi_wallets",
215
+ "cwd": "/path/to/agentlili",
241
216
  "env": {
242
217
  "WALLET_ENCRYPTION_KEY": "<your-key>",
243
218
  "SOLANA_RPC_URL": "https://api.devnet.solana.com"
@@ -247,9 +222,9 @@ WALLET_ENCRYPTION_KEY=<key> pnpm mcp
247
222
  }
248
223
  ```
249
224
 
250
- **18 tools** across 5 categories: wallet operations, FROST threshold signing, agent lifecycle management, spending & security controls, and portfolio analytics.
225
+ Tools across wallet operations, agent lifecycle management, spending & security controls, and portfolio analytics.
251
226
 
252
- **5 guided prompts**: portfolio overview, security audit, agent creation, fleet health check, and wallet investigation.
227
+ **Guided prompts**: portfolio overview, security audit, agent creation, fleet health check, and wallet investigation.
253
228
 
254
229
  ---
255
230
 
@@ -280,8 +255,6 @@ All write/delete endpoints verify HMAC-SHA256 signatures when `X-Signature` head
280
255
  | GET | `/api/wallet/:id/history` | Paginated transaction history |
281
256
  | GET | `/api/wallet/:id/limits` | Get spending limits (maxPerTx, maxPerDay, dailySpent) |
282
257
  | PUT | `/api/wallet/:id/limits` | Update spending limits. Body: `{ "maxPerTx": 0.5, "maxPerDay": 2 }` |
283
- | GET | `/api/wallet/:id/strategy` | Get risk strategy (conservative/balanced/aggressive) |
284
- | PUT | `/api/wallet/:id/strategy` | Set strategy. Body: `{ "strategyId": "conservative" }` |
285
258
  | POST | `/api/wallet/:id/backup` | Export password-protected encrypted backup |
286
259
  | PUT | `/api/wallet/:id/backup` | Restore wallet from backup file + password |
287
260
  | POST | `/api/wallet/:id?action=rekey` | Re-encrypt wallet with fresh salt + IV (forward secrecy) |
@@ -293,31 +266,27 @@ All write/delete endpoints verify HMAC-SHA256 signatures when `X-Signature` head
293
266
  | GET | `/api/agents` | List all agents with SOL balances |
294
267
  | POST | `/api/agents` | Spawn agent. Body: `{ "label": "Bot Name" }` — auto-airdrops |
295
268
  | POST | `/api/agents/bulk` | Batch-create up to 20 agents. Body: `{ "labels": ["Bot1", "Bot2"] }` — returns array of walletIds |
296
- | GET | `/api/agents/monitor` | Full monitoring data. Params: `?status=active&strategy=conservative&limit=10` |
269
+ | GET | `/api/agents/monitor` | Full monitoring data. Params: `?status=active&limit=10` |
297
270
  | POST | `/api/agents/transfer` | Agent-to-agent transfer. Body: `{ "fromAgent", "toAgent", "amount", "mint?" }` |
298
271
  | GET | `/api/agents/:id/lifecycle` | Get lifecycle state and transition history |
299
272
  | PUT | `/api/agents/:id/lifecycle` | Transition state. Body: `{ "state": "paused" \| "active" \| "terminated" }` |
300
273
  | POST | `/api/agents/:id/run` | Trigger one autonomous execution cycle — no human prompt needed |
301
274
  | GET | `/api/agents/health-summary` | Aggregate security health across all agents: avg score, grade distribution, attention list |
302
275
 
303
- ### FROST Threshold Signing
276
+ ### Kora Gasless Transactions
304
277
 
305
278
  | Method | Endpoint | Description |
306
279
  |--------|----------|-------------|
307
- | GET | `/api/frost` | List all FROST wallets (metadata only) |
308
- | POST | `/api/frost` | Create FROST wallet. Body: `{ "threshold": 2, "totalShares": 3, "labels": [...] }` |
309
- | GET | `/api/frost/:id` | Get FROST wallet details + security health |
310
- | DELETE | `/api/frost/:id` | Delete FROST wallet and all encrypted shares |
311
- | POST | `/api/frost/:id/sign` | Execute FROST signing ceremony. Body: `{ "message", "participantIds", "intent?" }` |
312
- | POST | `/api/frost/:id/refresh` | Refresh shares (proactive key rotation) — group key unchanged |
280
+ | GET | `/api/kora/status` | Kora paymaster status: enabled/disabled, fee mode, payer address, supported tokens |
281
+ | POST | `/api/kora/estimate` | Estimate transaction fee. Body: `{ "transaction": "<base64>", "feeToken?": "<mint>" }` |
313
282
 
314
- ### Kora Gasless Transactions
283
+ ### Scheduler
315
284
 
316
285
  | Method | Endpoint | Description |
317
286
  |--------|----------|-------------|
318
- | GET | `/api/kora/status` | Kora paymaster status: enabled/disabled, fee mode, payer address, supported tokens |
319
- | POST | `/api/kora/estimate` | Estimate transaction fee. Body: `{ "transaction": "<base64>", "feeToken?": "<mint>" }` |
320
- | POST | `/api/frost/:id/sign-kora` | FROST sign + Kora co-sign and submit. Body: `{ "transaction", "participantIds", "intent?", "feeToken?" }` |
287
+ | POST | `/api/cron/tick` | Trigger scheduler tick. Auth: `Bearer CRON_SECRET`. Body: `{ "walletIds?": [...], "cluster?": "devnet", "dryRun?": false }` |
288
+
289
+ Call this from any external scheduler (cron-job.org, GitHub Actions, systemd timer, etc.) to process scheduled payments and subscriptions. Supports wallet filtering and dry-run mode.
321
290
 
322
291
  ### Chat & Operations
323
292
 
@@ -375,17 +344,17 @@ curl localhost:3000/api/agents/monitor
375
344
 
376
345
  Three pre-built autonomous scenarios launch with one click (UI or API):
377
346
 
378
- | Scenario | Strategy | Description |
379
- |----------|----------|-------------|
380
- | `defi-explorer` | Balanced | Check balance, fetch SOL price, swap to USDC, summarize portfolio |
381
- | `multi-protocol` | Balanced | Diversify across staking, swaps, and liquidity provision |
382
- | `trading-bot` | Aggressive | Market analysis, conditional trades, position reporting |
347
+ | Scenario | Description |
348
+ |----------|-------------|
349
+ | `defi-explorer` | Check balance, fetch SOL price, swap to USDC, summarize portfolio |
350
+ | `multi-protocol` | Diversify across staking, swaps, and liquidity provision |
351
+ | `trading-bot` | Market analysis, conditional trades, position reporting |
383
352
 
384
353
  ```bash
385
354
  # List scenarios
386
355
  curl localhost:3000/api/demo
387
356
 
388
- # Launch a scenario (creates wallet, airdrops, sets strategy, returns prompt)
357
+ # Launch a scenario (creates wallet, airdrops, returns prompt)
389
358
  curl -X POST localhost:3000/api/demo \
390
359
  -H 'Content-Type: application/json' \
391
360
  -d '{"scenarioId": "trading-bot"}'
@@ -393,41 +362,14 @@ curl -X POST localhost:3000/api/demo \
393
362
 
394
363
  ---
395
364
 
396
- ## Running the Demos
397
-
398
- ```bash
399
- # Basic demo: wallet creation + airdrop + transaction signing
400
- pnpm demo
401
-
402
- # DeFi demo: AI agent autonomously executes multi-step DeFi operations
403
- pnpm demo:defi
404
-
405
- # Multi-agent demo: 3 concurrent agents with timing + memory metrics
406
- pnpm demo:multi
407
-
408
- # Stress test: 12 concurrent agents across 7 phases, with isolation verification
409
- pnpm stress-test
410
- # Override agent count: STRESS_AGENTS=20 pnpm stress-test
411
- ```
412
-
413
- See [DEMO.md](./DEMO.md) for a detailed judge-friendly walkthrough.
414
-
415
- ---
416
-
417
365
  ## Test Suite
418
366
 
419
367
  ```bash
420
- # Unit + API tests (~4s)
368
+ # Unit tests
421
369
  pnpm test
422
370
 
423
- # With V8 coverage report
424
- pnpm test --coverage
425
-
426
- # On-chain tests against local validator (requires solana-test-validator)
427
- pnpm validator:start && pnpm test:localnet
428
-
429
- # E2E tests with Playwright (16 specs — requires dev server)
430
- pnpm test:e2e
371
+ # On-chain tests against Surfpool (requires Surfpool on localhost:8899)
372
+ pnpm test:surfpool
431
373
 
432
374
  # Integration tests against devnet (requires RUN_INTEGRATION=1)
433
375
  pnpm test:integration
@@ -439,63 +381,25 @@ pnpm typecheck
439
381
  pnpm build
440
382
  ```
441
383
 
442
- **Test breakdown (1,000+ total across 4 layers, zero mocks):**
443
-
444
- | Layer | Tests | Files | What it covers |
445
- |-------|------:|------:|----------------|
446
- | Unit + API (Vitest) | 743 | 44 | Core library, API routes, tool count, stress-lite — **zero mocks** |
447
- | FROST (Vitest) | 140 | 11 | Key management, ceremony, signer, policy, nonce, vault, share refresh, SATI, refresh triggers, e2e |
448
- | Kora (Vitest) | 19 | 4 | Config, client, transaction prep, FROST+Kora adapter, gasless on-chain SOL transfers |
449
- | Localnet (Vitest) | 40 | 6 | Real SOL transfers, balance queries, airdrops, health, full 17-phase workflow, **12 LLM vulnerability tests** — against `solana-test-validator` |
450
- | E2E (Playwright) | 16 | 1 | Wallet creation → airdrop → chat → on-chain verification |
451
- | Integration (devnet) | 55+ | 1 | Airdrop, SOL transfer, multi-agent, DeFi tool invocation via Solana Agent Kit |
452
-
453
- Run localnet tests: `pnpm test:localnet` (requires `solana-test-validator`)
454
- Run integration tests (requires devnet RPC): `pnpm test:integration`
455
-
456
- **CI/CD:** GitHub Actions pipeline runs lint → test → typecheck → build → E2E on every push to main.
457
-
458
- Test categories:
459
- - Wallet encryption/decryption (AES-256-GCM, scrypt, round-trips, tamper detection)
460
- - Wallet CRUD and multi-agent isolation
461
- - Rate limiter logic, per-bucket presets, memory management
462
- - Spending limits enforcement, daily window, SOL extraction
463
- - HMAC request signing (sign, verify, replay protection, timing-safe compare)
464
- - Audit log integrity chain (HMAC, filtering, pagination)
465
- - Agent lifecycle state machine (transitions, terminal state, executable gate)
466
- - Agent-to-agent transfer validation, lifecycle + spending guards
467
- - Agent monitor aggregation, status derivation, sorting
468
- - Portfolio aggregation, Jupiter price integration, allocation calc
469
- - Analytics (time series, category breakdown, top tools, wallet activity)
470
- - Demo scenarios (data integrity, prompt quality, strategy assignments)
471
- - SSE event bus (client management, wallet filtering, reconnect, keep-alive)
472
- - Toast notifications, copy button, loading skeletons (jsdom)
473
- - Theme system, mobile responsive layout (jsdom)
474
- - Error boundaries: RPC down, empty wallet, rate limit, lifecycle block, missing env
475
- - E2E: full wallet → airdrop → chat → on-chain verification (Playwright)
384
+ Tests run via `pnpm test` (unit) and `pnpm test:surfpool` (on-chain). See [CLAUDE.md](./CLAUDE.md) for full test runner details and Surfpool cheatcodes.
476
385
 
477
386
  ---
478
387
 
479
388
  ## Security
480
389
 
481
- See [SECURITY.md](./SECURITY.md) for the full threat model. Key properties:
390
+ See [Security & Threat Model](../resources/docs/00-overview.md#threat-model-summary) for the full threat model. Key properties:
482
391
 
483
392
  | Property | Implementation |
484
393
  |----------|----------------|
485
- | Key storage | AES-256-GCM + scrypt (N=2^14, r=8, p=1) per-wallet salt |
486
- | Key export | Never no API endpoint reads raw private key bytes |
487
- | Key re-encryption | `POST /api/wallet/:id?action=rekey` rotates salt+IV; old ciphertext becomes stale |
488
- | Backup | AES-256-GCM + scrypt (N=2^17) under user password |
394
+ | Key custody | Turnkey secure enclave hardware-backed, keys never in application memory |
395
+ | Wallet derivation | BIP-32 HD wallet; per-agent sub-accounts at `m/44'/501'/{unixSeconds}'/0'` |
396
+ | On-chain enforcement | PDA vault (Anchor program) spending limits, program allowlists, cooldowns |
397
+ | Gasless transactions | Kora paymaster co-signs as fee payer; agents don't need SOL for gas |
489
398
  | API authentication | HMAC-SHA256 + 5-minute replay window |
490
399
  | Rate limiting | Per-IP sliding window, 12 per-bucket presets |
491
- | Spending controls | Configurable per-tx + per-day SOL caps, enforced server-side |
400
+ | Spending controls | Configurable per-tx + per-day SOL caps, enforced server-side + on-chain |
492
401
  | Audit trail | HMAC-SHA256 integrity chain, append-only JSONL |
493
- | FROST threshold signing | 2-of-3 RFC 9591 shares no single point of compromise |
494
- | PolicyParticipant | Independent TX validation: program allowlist, spending limits, intent matching |
495
- | PDA Vault | Anchor program enforces on-chain spending limits and CPI allowlist |
496
- | Gasless transactions | Kora paymaster co-signs as fee payer; agents don't need SOL for gas |
497
- | Prompt injection defense | PolicyParticipant validates TX semantics, not natural language (see SECURITY.md §6) |
498
- | Agent isolation | Separate keypair, RPC context, ledger, lifecycle state per agent |
402
+ | Agent isolation | Separate wallet sub-account, RPC context, ledger, lifecycle state per agent |
499
403
  | Path traversal | Wallet IDs validated as 8-char hex by strict regex before any file I/O |
500
404
  | XSS prevention | HTML stripped from all user-supplied labels |
501
405
 
@@ -508,10 +412,9 @@ See [SECURITY.md](./SECURITY.md) for the full threat model. Key properties:
508
412
  | Framework | Next.js 15 (App Router) |
509
413
  | AI | Vercel AI SDK 4 (`streamText`, `useChat`, `maxSteps: 10`) |
510
414
  | Solana | solana-agent-kit 2.0 — TokenPlugin (26 tools) + DefiPlugin (70 tools) |
511
- | Encryption | Node.js `crypto`AES-256-GCM, scrypt KDF |
512
- | FROST | `@substrate-system/frost` v0.0.9RFC 9591 Ed25519 threshold signatures |
513
- | Gasless Txs | Kora paymaster (`@solana/kora` SDK) fee payer co-signing, token fee abstraction |
514
- | On-chain | 2 Anchor programs — `agent_vault` (PDA policy) + `agent_sati` (on-chain identity) |
415
+ | Key Custody | Turnkey secure enclave hardware-backed HD wallet, BIP-32 sub-accounts |
416
+ | Gasless Txs | Kora paymasterfee payer co-signing, token fee abstraction |
417
+ | On-chain | Anchor program `agent_vault` (PDA vault: spending limits, program allowlists) |
515
418
  | UI | React 19, Tailwind CSS 4, pure SVG charts |
516
419
  | Testing | Vitest (unit), Playwright (E2E), @vitest/coverage-v8 |
517
420
  | CI/CD | GitHub Actions — lint, test, typecheck, build, E2E |
@@ -524,8 +427,8 @@ See [SECURITY.md](./SECURITY.md) for the full threat model. Key properties:
524
427
  | File | Contents |
525
428
  |------|----------|
526
429
  | [DEMO.md](./DEMO.md) | Judge-friendly demo walkthrough (start here) |
527
- | [DEEP_DIVE.md](./DEEP_DIVE.md) | 1,500+ line architecture deep dive with 22 Mermaid diagrams |
528
- | [SECURITY.md](./SECURITY.md) | STRIDE threat model, cryptographic inventory, attack surface map |
430
+ | [Docs set](../resources/docs/00-overview.md) | 11-chapter architecture deep dive with diagrams |
431
+ | [Threat Model](../resources/docs/00-overview.md#threat-model-summary) | Threat model, cryptographic inventory, attack surface map |
529
432
  | [BENCHMARK.md](./BENCHMARK.md) | Stress test: 12 agents, 76 ops, 0% errors, 1.8s, isolation proof |
530
433
  | [SKILLS.md](./SKILLS.md) | Complete agent capability catalog (93 tools, for agents to read) |
531
434
  | [VIDEO_SCRIPT.md](./VIDEO_SCRIPT.md) | 7-scene, 5-minute demo recording script |
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/lib/agent.ts
4
+ import { SolanaAgentKit } from "solana-agent-kit";
5
+ import TokenPlugin from "@solana-agent-kit/plugin-token";
6
+ import DefiPlugin from "@solana-agent-kit/plugin-defi";
7
+ import { createVercelAITools } from "solana-agent-kit";
8
+ var CORE_ACTION_NAMES = /* @__PURE__ */ new Set([
9
+ "GET_TOKEN_DATA",
10
+ "GET_TOKEN_DATA_OR_INFO_BY_TICKER_OR_SYMBOL",
11
+ "FETCH_PRICE",
12
+ "STAKE_WITH_JUPITER",
13
+ "TRADE",
14
+ "CREATE_LIMIT_ORDER",
15
+ "CANCEL_LIMIT_ORDERS",
16
+ "GET_OPEN_LIMIT_ORDERS",
17
+ "GET_LIMIT_ORDER_HISTORY",
18
+ "BALANCE_ACTION",
19
+ "TOKEN_BALANCE_ACTION",
20
+ "GET_TPS",
21
+ "CLOSE_EMPTY_TOKEN_ACCOUNTS",
22
+ "REQUEST_FUNDS",
23
+ "TRANSFER",
24
+ "PYTH_FETCH_PRICE",
25
+ "RUGCHECK",
26
+ "WALLET_ADDRESS",
27
+ "LEND_ASSET",
28
+ "LULO_LEND",
29
+ "LULO_WITHDRAW"
30
+ ]);
31
+ function createAgent(wallet, config, rpcUrl) {
32
+ const agentConfig = {};
33
+ if (config.llmProvider === "openai") {
34
+ agentConfig.OPENAI_API_KEY = config.llmApiKey;
35
+ }
36
+ if (config.kora) {
37
+ agentConfig.KORA_ENDPOINT = config.kora.endpoint;
38
+ if (config.kora.apiKey) agentConfig.KORA_API_KEY = config.kora.apiKey;
39
+ if (config.kora.feeToken) agentConfig.KORA_FEE_TOKEN = config.kora.feeToken;
40
+ }
41
+ const agent = new SolanaAgentKit(wallet, rpcUrl ?? "http://localhost:8899", agentConfig).use(TokenPlugin).use(DefiPlugin);
42
+ const toolMode = process.env.CHAT_TOOL_MODE ?? "core";
43
+ const actions = toolMode === "all" ? agent.actions : agent.actions.filter((a) => CORE_ACTION_NAMES.has(a.name));
44
+ const tools = createVercelAITools(agent, actions);
45
+ return { agent, tools };
46
+ }
47
+ export {
48
+ CORE_ACTION_NAMES,
49
+ createAgent
50
+ };
51
+ //# sourceMappingURL=agent-7OQQFXF5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/agent.ts"],"sourcesContent":["import { SolanaAgentKit } from \"solana-agent-kit\";\nimport TokenPlugin from \"@solana-agent-kit/plugin-token\";\nimport DefiPlugin from \"@solana-agent-kit/plugin-defi\";\nimport { createVercelAITools } from \"solana-agent-kit\";\nimport type { ToolSet } from \"ai\";\nimport type { AppConfig } from \"./config\";\nimport type { LiliWalletInterface } from \"./lili\";\n\n/**\n * ~20 core actions that cover the most common DeFi operations.\n * Keeps tool-definition payload under Groq's token limit (~4K vs ~15K for all 93).\n */\nexport const CORE_ACTION_NAMES = new Set([\n \"GET_TOKEN_DATA\",\n \"GET_TOKEN_DATA_OR_INFO_BY_TICKER_OR_SYMBOL\",\n \"FETCH_PRICE\",\n \"STAKE_WITH_JUPITER\",\n \"TRADE\",\n \"CREATE_LIMIT_ORDER\",\n \"CANCEL_LIMIT_ORDERS\",\n \"GET_OPEN_LIMIT_ORDERS\",\n \"GET_LIMIT_ORDER_HISTORY\",\n \"BALANCE_ACTION\",\n \"TOKEN_BALANCE_ACTION\",\n \"GET_TPS\",\n \"CLOSE_EMPTY_TOKEN_ACCOUNTS\",\n \"REQUEST_FUNDS\",\n \"TRANSFER\",\n \"PYTH_FETCH_PRICE\",\n \"RUGCHECK\",\n \"WALLET_ADDRESS\",\n \"LEND_ASSET\",\n \"LULO_LEND\",\n \"LULO_WITHDRAW\",\n]);\n\nexport function createAgent(\n wallet: LiliWalletInterface,\n config: AppConfig,\n rpcUrl?: string,\n): {\n agent: SolanaAgentKit;\n tools: ToolSet;\n} {\n const agentConfig: Record<string, string | number | boolean> = {};\n\n if (config.llmProvider === \"openai\") {\n agentConfig.OPENAI_API_KEY = config.llmApiKey;\n }\n\n // Pass Kora endpoint to agent config when enabled\n if (config.kora) {\n agentConfig.KORA_ENDPOINT = config.kora.endpoint;\n if (config.kora.apiKey) agentConfig.KORA_API_KEY = config.kora.apiKey;\n if (config.kora.feeToken) agentConfig.KORA_FEE_TOKEN = config.kora.feeToken;\n }\n\n const agent = new SolanaAgentKit(wallet, rpcUrl ?? \"http://localhost:8899\", agentConfig)\n .use(TokenPlugin)\n .use(DefiPlugin);\n\n const toolMode = process.env.CHAT_TOOL_MODE ?? \"core\";\n const actions =\n toolMode === \"all\"\n ? agent.actions\n : agent.actions.filter((a: { name: string }) => CORE_ACTION_NAMES.has(a.name));\n\n const tools = createVercelAITools(agent, actions) as unknown as ToolSet;\n\n return { agent, tools };\n}\n"],"mappings":";;;AAAA,SAAS,sBAAsB;AAC/B,OAAO,iBAAiB;AACxB,OAAO,gBAAgB;AACvB,SAAS,2BAA2B;AAS7B,IAAM,oBAAoB,oBAAI,IAAI;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEM,SAAS,YACd,QACA,QACA,QAIA;AACA,QAAM,cAAyD,CAAC;AAEhE,MAAI,OAAO,gBAAgB,UAAU;AACnC,gBAAY,iBAAiB,OAAO;AAAA,EACtC;AAGA,MAAI,OAAO,MAAM;AACf,gBAAY,gBAAgB,OAAO,KAAK;AACxC,QAAI,OAAO,KAAK,OAAQ,aAAY,eAAe,OAAO,KAAK;AAC/D,QAAI,OAAO,KAAK,SAAU,aAAY,iBAAiB,OAAO,KAAK;AAAA,EACrE;AAEA,QAAM,QAAQ,IAAI,eAAe,QAAQ,UAAU,yBAAyB,WAAW,EACpF,IAAI,WAAW,EACf,IAAI,UAAU;AAEjB,QAAM,WAAW,QAAQ,IAAI,kBAAkB;AAC/C,QAAM,UACJ,aAAa,QACT,MAAM,UACN,MAAM,QAAQ,OAAO,CAAC,MAAwB,kBAAkB,IAAI,EAAE,IAAI,CAAC;AAEjF,QAAM,QAAQ,oBAAoB,OAAO,OAAO;AAEhD,SAAO,EAAE,OAAO,MAAM;AACxB;","names":[]}
@@ -0,0 +1,111 @@
1
+ import {
2
+ prisma
3
+ } from "./chunk-R7JN32HS.js";
4
+
5
+ // src/lib/messaging/command-parser.ts
6
+ var WALLET_ID_PATTERN = /^[a-f0-9-]{8}$/;
7
+ function isValidWalletId(id) {
8
+ return WALLET_ID_PATTERN.test(id);
9
+ }
10
+
11
+ // src/lib/messaging/chat-bindings.ts
12
+ async function getBinding(platform, chatId) {
13
+ const row = await prisma.chatBinding.findUnique({
14
+ where: { platform_chatId: { platform, chatId } }
15
+ });
16
+ if (!row) return null;
17
+ return {
18
+ platform: row.platform,
19
+ chatId: row.chatId,
20
+ agentId: row.agentId,
21
+ muted: row.muted,
22
+ createdAt: row.createdAt.toISOString()
23
+ };
24
+ }
25
+ async function bindChat(platform, chatId, agentId) {
26
+ if (!isValidWalletId(agentId)) {
27
+ throw new Error(`Invalid wallet ID format: ${agentId}. Must be 8 hex characters.`);
28
+ }
29
+ const row = await prisma.chatBinding.upsert({
30
+ where: { platform_chatId: { platform, chatId } },
31
+ create: {
32
+ platform,
33
+ chatId,
34
+ agentId,
35
+ muted: false
36
+ },
37
+ update: {
38
+ agentId
39
+ // Keep existing muted state on update — handled by not overwriting it
40
+ }
41
+ });
42
+ return {
43
+ platform: row.platform,
44
+ chatId: row.chatId,
45
+ agentId: row.agentId,
46
+ muted: row.muted,
47
+ createdAt: row.createdAt.toISOString()
48
+ };
49
+ }
50
+ async function unbindChat(platform, chatId) {
51
+ try {
52
+ await prisma.chatBinding.delete({
53
+ where: { platform_chatId: { platform, chatId } }
54
+ });
55
+ return true;
56
+ } catch {
57
+ return false;
58
+ }
59
+ }
60
+ async function setMuted(platform, chatId, muted) {
61
+ try {
62
+ await prisma.chatBinding.update({
63
+ where: { platform_chatId: { platform, chatId } },
64
+ data: { muted }
65
+ });
66
+ return true;
67
+ } catch {
68
+ return false;
69
+ }
70
+ }
71
+ async function getBindingsForAgent(agentId) {
72
+ const rows = await prisma.chatBinding.findMany({
73
+ where: { agentId, muted: false }
74
+ });
75
+ return rows.map((row) => ({
76
+ platform: row.platform,
77
+ chatId: row.chatId,
78
+ agentId: row.agentId,
79
+ muted: row.muted,
80
+ createdAt: row.createdAt.toISOString()
81
+ }));
82
+ }
83
+ async function getBindingsForProfile(profileId) {
84
+ const agents = await prisma.agent.findMany({
85
+ where: { ownerProfileId: profileId },
86
+ select: { id: true }
87
+ });
88
+ if (agents.length === 0) return [];
89
+ const rows = await prisma.chatBinding.findMany({
90
+ where: {
91
+ muted: false,
92
+ agentId: { in: agents.map((agent) => agent.id) }
93
+ }
94
+ });
95
+ return rows.map((row) => ({
96
+ platform: row.platform,
97
+ chatId: row.chatId,
98
+ agentId: row.agentId,
99
+ muted: row.muted,
100
+ createdAt: row.createdAt.toISOString()
101
+ }));
102
+ }
103
+ export {
104
+ bindChat,
105
+ getBinding,
106
+ getBindingsForAgent,
107
+ getBindingsForProfile,
108
+ setMuted,
109
+ unbindChat
110
+ };
111
+ //# sourceMappingURL=chat-bindings-RYWDO7CX.js.map