@agent-shield/plugin-elizaos 0.1.2 → 0.3.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 (65) hide show
  1. package/README.md +215 -29
  2. package/dist/actions/index.d.ts +4 -3
  3. package/dist/actions/index.d.ts.map +1 -1
  4. package/dist/actions/index.js +9 -7
  5. package/dist/actions/index.js.map +1 -1
  6. package/dist/actions/pauseResume.d.ts +14 -0
  7. package/dist/actions/pauseResume.d.ts.map +1 -0
  8. package/dist/actions/pauseResume.js +89 -0
  9. package/dist/actions/pauseResume.js.map +1 -0
  10. package/dist/actions/status.d.ts +14 -0
  11. package/dist/actions/status.d.ts.map +1 -0
  12. package/dist/actions/status.js +74 -0
  13. package/dist/actions/status.js.map +1 -0
  14. package/dist/actions/transactionHistory.d.ts +14 -0
  15. package/dist/actions/transactionHistory.d.ts.map +1 -0
  16. package/dist/actions/transactionHistory.js +89 -0
  17. package/dist/actions/transactionHistory.js.map +1 -0
  18. package/dist/actions/{swap.d.ts → updatePolicy.d.ts} +4 -8
  19. package/dist/actions/updatePolicy.d.ts.map +1 -0
  20. package/dist/actions/updatePolicy.js +83 -0
  21. package/dist/actions/updatePolicy.js.map +1 -0
  22. package/dist/client-factory.d.ts +5 -8
  23. package/dist/client-factory.d.ts.map +1 -1
  24. package/dist/client-factory.js +53 -33
  25. package/dist/client-factory.js.map +1 -1
  26. package/dist/evaluators/policyCheck.d.ts +2 -2
  27. package/dist/evaluators/policyCheck.d.ts.map +1 -1
  28. package/dist/evaluators/policyCheck.js +25 -29
  29. package/dist/evaluators/policyCheck.js.map +1 -1
  30. package/dist/index.d.ts +3 -3
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +7 -6
  33. package/dist/index.js.map +1 -1
  34. package/dist/plugin.d.ts +24 -68
  35. package/dist/plugin.d.ts.map +1 -1
  36. package/dist/plugin.js +14 -20
  37. package/dist/plugin.js.map +1 -1
  38. package/dist/providers/index.d.ts +1 -1
  39. package/dist/providers/index.d.ts.map +1 -1
  40. package/dist/providers/index.js +2 -2
  41. package/dist/providers/index.js.map +1 -1
  42. package/dist/providers/spendTracking.d.ts +7 -9
  43. package/dist/providers/spendTracking.d.ts.map +1 -1
  44. package/dist/providers/spendTracking.js +25 -32
  45. package/dist/providers/spendTracking.js.map +1 -1
  46. package/dist/providers/vaultStatus.d.ts +11 -15
  47. package/dist/providers/vaultStatus.d.ts.map +1 -1
  48. package/dist/providers/vaultStatus.js +22 -30
  49. package/dist/providers/vaultStatus.js.map +1 -1
  50. package/dist/types.d.ts +6 -10
  51. package/dist/types.d.ts.map +1 -1
  52. package/dist/types.js +4 -6
  53. package/dist/types.js.map +1 -1
  54. package/package.json +20 -14
  55. package/dist/actions/closePosition.d.ts +0 -27
  56. package/dist/actions/closePosition.d.ts.map +0 -1
  57. package/dist/actions/closePosition.js +0 -86
  58. package/dist/actions/closePosition.js.map +0 -1
  59. package/dist/actions/openPosition.d.ts +0 -31
  60. package/dist/actions/openPosition.d.ts.map +0 -1
  61. package/dist/actions/openPosition.js +0 -91
  62. package/dist/actions/openPosition.js.map +0 -1
  63. package/dist/actions/swap.d.ts.map +0 -1
  64. package/dist/actions/swap.js +0 -82
  65. package/dist/actions/swap.js.map +0 -1
package/README.md CHANGED
@@ -1,14 +1,14 @@
1
1
  # @agent-shield/plugin-elizaos
2
2
 
3
- AgentShield plugin for [ElizaOS](https://github.com/elizaOS/eliza) — provides DeFi actions, vault status providers, and policy evaluators for AI agents operating through permission-guarded Solana vaults.
3
+ AgentShield plugin for [ElizaOS](https://github.com/elizaOS/eliza) — provides shield status actions, pause/resume controls, transaction history, spending providers, and policy evaluators for AI agents with client-side spending controls. Zero on-chain setup required.
4
4
 
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
- npm install @agent-shield/plugin-elizaos @agent-shield/sdk
8
+ npm install @agent-shield/plugin-elizaos @agent-shield/solana
9
9
  ```
10
10
 
11
- Peer dependencies: `@elizaos/core >=0.1.0`, `@agent-shield/sdk >=0.1.0`, `@solana/web3.js >=1.90.0`, `@coral-xyz/anchor >=0.30.0`
11
+ Peer dependencies: `@elizaos/core >=0.1.0`, `@agent-shield/solana >=0.1.0`, `@solana/web3.js >=1.90.0`
12
12
 
13
13
  ## Quick Start
14
14
 
@@ -25,52 +25,238 @@ const character = {
25
25
  };
26
26
  ```
27
27
 
28
+ The plugin reads environment variables to create a `ShieldedWallet` automatically. Event callbacks (`onDenied`, `onApproved`, `onPause`, `onResume`, `onPolicyUpdate`) are wired to the ElizaOS runtime logger.
29
+
28
30
  ## Environment Variables
29
31
 
30
- | Variable | Required | Description |
31
- |----------|----------|-------------|
32
- | `AGENT_SHIELD_VAULT_OWNER` | Yes | Vault owner public key (base58) |
33
- | `AGENT_SHIELD_VAULT_ID` | Yes | Vault identifier (u64 as string) |
34
- | `SOLANA_RPC_URL` | Yes | Solana RPC endpoint |
35
- | `SOLANA_WALLET_PRIVATE_KEY` | Yes | Agent wallet private key (base58 or JSON array) |
36
- | `AGENT_SHIELD_PROGRAM_ID` | No | Custom program ID override |
32
+ | Variable | Required | Description | Default |
33
+ |----------|----------|-------------|---------|
34
+ | `SOLANA_WALLET_PRIVATE_KEY` | Yes | Agent wallet private key (base58 or JSON array) | - |
35
+ | `AGENT_SHIELD_MAX_SPEND` | No | Spending limit string | `"1000 USDC/day"` + `"1000 USDT/day"` + `"10 SOL/day"` |
36
+ | `AGENT_SHIELD_BLOCK_UNKNOWN` | No | Block unknown programs | `"true"` |
37
+
38
+ **Private key formats supported:**
39
+ - Base58 string: `"4wBqp..."` (standard Solana CLI format)
40
+ - JSON array: `"[104,29,171,...]"` (Uint8Array bytes)
37
41
 
38
42
  ## Actions
39
43
 
40
- The plugin provides 3 actions that agents can invoke conversationally:
44
+ The plugin provides 4 actions that agents can invoke conversationally:
41
45
 
42
- | Action | Description |
43
- |--------|-------------|
44
- | `SHIELD_SWAP` | Execute a token swap through Jupiter, routed through the AgentShield vault with on-chain policy enforcement (spending caps, token whitelists) |
45
- | `SHIELD_OPEN_POSITION` | Open a leveraged perpetual position on Flash Trade through the vault. Enforces leverage limits and position count caps |
46
- | `SHIELD_CLOSE_POSITION` | Close an existing perpetual position on Flash Trade through the vault |
46
+ ### `SHIELD_STATUS`
47
+
48
+ **Triggers:** "shield status", "spending status", "budget remaining", "check spending", "how much budget"
49
+
50
+ Returns current spending summary including enforcement state, per-token usage with percentages, and rate limit status.
51
+
52
+ **Example conversation:**
53
+ ```
54
+ User: "What's my shield spending status?"
55
+ Agent: "=== AgentShield Status ===
56
+ Enforcement: ACTIVE
57
+
58
+ USDC: 200000000 / 500000000 (40% used)
59
+ Remaining: 300000000
60
+
61
+ Rate limit: 5/60 transactions (55 remaining)"
62
+ ```
63
+
64
+ ### `SHIELD_UPDATE_POLICY`
65
+
66
+ **Triggers:** "update policy", "change limit", "change spending cap", "set budget", "update shield"
67
+
68
+ Updates spending limits or program blocking at runtime.
69
+
70
+ **Message parameters:**
71
+ - `maxSpend` (string) — new spending limit, e.g. `"1000 USDC/day"`
72
+ - `blockUnknownPrograms` (boolean) — whether to block unknown programs
73
+
74
+ **Example conversation:**
75
+ ```
76
+ User: "Update my shield limit to 1000 USDC per day"
77
+ Agent: "Shield policies updated: maxSpend: 1000 USDC/day"
78
+ ```
79
+
80
+ ### `SHIELD_PAUSE_RESUME`
81
+
82
+ **Triggers:** "pause shield", "resume shield", "pause enforcement", "resume enforcement", "disable shield", "enable shield"
83
+
84
+ Pauses or resumes policy enforcement. The action infers the intent (pause vs resume) from the message text. When paused, transactions pass through without policy checks or spend recording.
85
+
86
+ **Example conversations:**
87
+ ```
88
+ User: "Pause the shield enforcement"
89
+ Agent: "Shield enforcement paused. Transactions will pass through without policy checks."
90
+
91
+ User: "Resume shield enforcement"
92
+ Agent: "Shield enforcement resumed. Policy checks are active."
93
+ ```
94
+
95
+ ### `SHIELD_TRANSACTION_HISTORY`
96
+
97
+ **Triggers:** "transaction history", "recent activity", "shield history", "spending history", "activity log"
98
+
99
+ Returns a detailed per-token usage summary with percentages, remaining budgets, rolling window information, and rate limit status.
100
+
101
+ **Example conversation:**
102
+ ```
103
+ User: "Show me the transaction history"
104
+ Agent: "=== AgentShield Transaction History ===
105
+ Enforcement: ACTIVE
106
+
107
+ --- Per-Token Usage ---
108
+ USDC:
109
+ Spent: 200000000 / 500000000
110
+ Usage: 40%
111
+ Remaining: 300000000
112
+ Window: 24h rolling
113
+
114
+ --- Rate Limit ---
115
+ Transactions: 5 / 60
116
+ Remaining: 55
117
+ Window: 1h"
118
+ ```
47
119
 
48
120
  ## Providers
49
121
 
50
- Providers inject vault context into the agent's memory before each response:
122
+ Providers inject shield context into the agent's memory before each response, giving the agent continuous awareness of its spending state:
51
123
 
52
- | Provider | Description |
53
- |----------|-------------|
54
- | `vaultStatusProvider` | Injects current vault status, agent key, total volume, open positions, and fees collected into the agent's context |
55
- | `spendTrackingProvider` | Injects rolling 24h spending data per token and recent transaction history so the agent is aware of remaining budget |
124
+ ### `shieldStatusProvider`
125
+
126
+ **Name:** `AGENT_SHIELD_STATUS`
127
+
128
+ Injects into every conversation turn:
129
+ - Wallet address
130
+ - Enforcement state (ACTIVE or PAUSED)
131
+ - Per-token spending summary with percentages
132
+ - Rate limit usage
133
+
134
+ **Returned data:**
135
+ ```typescript
136
+ {
137
+ text: "AgentShield Status: ...", // Human-readable for agent context
138
+ values: {
139
+ address: "...",
140
+ isPaused: false,
141
+ tokens: [...],
142
+ rateLimit: { ... },
143
+ }
144
+ }
145
+ ```
146
+
147
+ ### `spendTrackingProvider`
148
+
149
+ **Name:** `AGENT_SHIELD_SPEND_TRACKING`
150
+
151
+ Injects per-token spending data with:
152
+ - Usage percentages per token
153
+ - Rolling window durations (in hours)
154
+ - Remaining budget per token
155
+ - Aggregate max usage percentage across all tokens
56
156
 
57
157
  ## Evaluators
58
158
 
59
- Evaluators run after shield actions to assess state:
159
+ ### `policyCheckEvaluator`
60
160
 
61
- | Evaluator | Description |
62
- |-----------|-------------|
63
- | `policyCheckEvaluator` | Runs after any shield action. Warns in agent memory when rolling 24h spend exceeds 80% of the daily cap, helping the agent self-regulate |
161
+ **Name:** `AGENT_SHIELD_POLICY_CHECK`
64
162
 
65
- ## How It Works
163
+ Post-action evaluator that warns when any token's spending exceeds 80% of its cap. Helps the agent self-regulate and avoid hitting hard limits.
164
+
165
+ **Triggers on:** Messages containing "agentshield", "shield", or "transaction:"
166
+
167
+ **Behavior:**
168
+ - Returns `null` if enforcement is paused (no warnings when paused)
169
+ - Checks each token against the 80% threshold
170
+ - Returns warning text with token name, usage percentage, and remaining budget
171
+ - Silently fails on errors (evaluators should never block the agent)
172
+
173
+ **Example warning:**
174
+ ```
175
+ "[AgentShield Warning] USDC spending at 85% of cap (150000000 remaining)"
176
+ ```
177
+
178
+ ## Event Callback Wiring
179
+
180
+ The plugin automatically wires shield event callbacks to the ElizaOS runtime logger:
66
181
 
67
- The plugin reads environment variables at runtime to create an `AgentShieldClient`. All actions build atomic composed transactions:
182
+ | Event | Log Level | Message |
183
+ |-------|-----------|---------|
184
+ | `onDenied` | `warn` | `[AgentShield] Transaction denied: <reason>` |
185
+ | `onApproved` | `info` | `[AgentShield] Transaction approved` |
186
+ | `onPause` | `info` | `[AgentShield] Enforcement paused` |
187
+ | `onResume` | `info` | `[AgentShield] Enforcement resumed` |
188
+ | `onPolicyUpdate` | `info` | `[AgentShield] Policies updated` |
68
189
 
190
+ Falls back to `console` if `runtime.logger` is not available.
191
+
192
+ ## Wallet Caching
193
+
194
+ The plugin uses a `WeakMap` to cache `ShieldedWallet` instances per ElizaOS runtime. This ensures:
195
+ - The same wallet is reused across all actions, providers, and evaluators within a runtime
196
+ - Spending state is consistent across the entire agent lifecycle
197
+ - Different runtime instances get independent wallets
198
+ - Wallets are garbage-collected when the runtime is released
199
+
200
+ ## Exported API
201
+
202
+ | Export | Description |
203
+ |--------|-------------|
204
+ | `agentShieldPlugin` | Plugin object for ElizaOS registration |
205
+ | `getConfig(runtime)` | Read config from runtime settings |
206
+ | `getOrCreateShieldedWallet(runtime)` | Get/create cached ShieldedWallet |
207
+ | `statusAction` | SHIELD_STATUS action |
208
+ | `updatePolicyAction` | SHIELD_UPDATE_POLICY action |
209
+ | `pauseResumeAction` | SHIELD_PAUSE_RESUME action |
210
+ | `transactionHistoryAction` | SHIELD_TRANSACTION_HISTORY action |
211
+ | `shieldStatusProvider` | Shield status context provider |
212
+ | `spendTrackingProvider` | Spend tracking context provider |
213
+ | `policyCheckEvaluator` | Policy cap warning evaluator |
214
+ | `ENV_KEYS` | Environment variable key constants |
215
+ | `AgentShieldElizaConfig` | Config type interface |
216
+
217
+ The plugin is also available as a default export for ElizaOS plugin loader compatibility.
218
+
219
+ ## How It Works
220
+
221
+ ```
222
+ ElizaOS Runtime
223
+
224
+ ├── Providers (inject context before each response)
225
+ │ ├── shieldStatusProvider → "Budget: 60% used"
226
+ │ └── spendTrackingProvider → "USDC: 300M/500M remaining"
227
+
228
+ ├── Actions (agent invokes conversationally)
229
+ │ ├── SHIELD_STATUS → detailed spending report
230
+ │ ├── SHIELD_UPDATE_POLICY → change limits at runtime
231
+ │ ├── SHIELD_PAUSE_RESUME → toggle enforcement
232
+ │ └── SHIELD_TRANSACTION_HISTORY → per-token usage details
233
+
234
+ ├── Evaluators (run after actions)
235
+ │ └── policyCheckEvaluator → "Warning: USDC at 85%"
236
+
237
+ └── ShieldedWallet (wraps signTransaction)
238
+ └── Policy engine → spending caps, rate limits, allowlists
69
239
  ```
70
- [ValidateAndAuthorize, DeFi instruction(s), FinalizeSession]
240
+
241
+ The `ShieldedWallet` wraps the agent's private key wallet and intercepts all `signTransaction` calls. Any DeFi action the agent takes — swaps, transfers, position opens — passes through the policy engine before the transaction is signed. If a policy is violated, the transaction is rejected with a descriptive error.
242
+
243
+ Providers give the agent continuous budget awareness. The evaluator proactively warns when spending approaches limits. No on-chain vault setup is needed.
244
+
245
+ ## Testing
246
+
247
+ ```bash
248
+ npm test
249
+ # Runs 30 tests covering all actions, providers, evaluator, config, caching, and event wiring
71
250
  ```
72
251
 
73
- Providers run before agent responses to inject vault context. The evaluator runs after shield actions to track budget usage.
252
+ ## Related Packages
253
+
254
+ | Package | Description |
255
+ |---------|-------------|
256
+ | [`@agent-shield/solana`](https://www.npmjs.com/package/@agent-shield/solana) | Core wallet wrapper (required) |
257
+ | [`@agent-shield/core`](https://www.npmjs.com/package/@agent-shield/core) | Pure TypeScript policy engine |
258
+ | [`@agent-shield/plugin-solana-agent-kit`](https://www.npmjs.com/package/@agent-shield/plugin-solana-agent-kit) | Solana Agent Kit integration |
259
+ | [`@agent-shield/sdk`](https://www.npmjs.com/package/@agent-shield/sdk) | On-chain vault SDK |
74
260
 
75
261
  ## License
76
262
 
@@ -1,4 +1,5 @@
1
- export { swapAction } from "./swap";
2
- export { openPositionAction } from "./openPosition";
3
- export { closePositionAction } from "./closePosition";
1
+ export { statusAction } from "./status";
2
+ export { updatePolicyAction } from "./updatePolicy";
3
+ export { pauseResumeAction } from "./pauseResume";
4
+ export { transactionHistoryAction } from "./transactionHistory";
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC"}
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.closePositionAction = exports.openPositionAction = exports.swapAction = void 0;
4
- var swap_1 = require("./swap");
5
- Object.defineProperty(exports, "swapAction", { enumerable: true, get: function () { return swap_1.swapAction; } });
6
- var openPosition_1 = require("./openPosition");
7
- Object.defineProperty(exports, "openPositionAction", { enumerable: true, get: function () { return openPosition_1.openPositionAction; } });
8
- var closePosition_1 = require("./closePosition");
9
- Object.defineProperty(exports, "closePositionAction", { enumerable: true, get: function () { return closePosition_1.closePositionAction; } });
3
+ exports.transactionHistoryAction = exports.pauseResumeAction = exports.updatePolicyAction = exports.statusAction = void 0;
4
+ var status_1 = require("./status");
5
+ Object.defineProperty(exports, "statusAction", { enumerable: true, get: function () { return status_1.statusAction; } });
6
+ var updatePolicy_1 = require("./updatePolicy");
7
+ Object.defineProperty(exports, "updatePolicyAction", { enumerable: true, get: function () { return updatePolicy_1.updatePolicyAction; } });
8
+ var pauseResume_1 = require("./pauseResume");
9
+ Object.defineProperty(exports, "pauseResumeAction", { enumerable: true, get: function () { return pauseResume_1.pauseResumeAction; } });
10
+ var transactionHistory_1 = require("./transactionHistory");
11
+ Object.defineProperty(exports, "transactionHistoryAction", { enumerable: true, get: function () { return transactionHistory_1.transactionHistoryAction; } });
10
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":";;;AAAA,+BAAoC;AAA3B,kGAAA,UAAU,OAAA;AACnB,+CAAoD;AAA3C,kHAAA,kBAAkB,OAAA;AAC3B,iDAAsD;AAA7C,oHAAA,mBAAmB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":";;;AAAA,mCAAwC;AAA/B,sGAAA,YAAY,OAAA;AACrB,+CAAoD;AAA3C,kHAAA,kBAAkB,OAAA;AAC3B,6CAAkD;AAAzC,gHAAA,iBAAiB,OAAA;AAC1B,2DAAgE;AAAvD,8HAAA,wBAAwB,OAAA"}
@@ -0,0 +1,14 @@
1
+ export declare const pauseResumeAction: {
2
+ name: string;
3
+ description: string;
4
+ similes: string[];
5
+ validate: (runtime: any, message: any) => Promise<boolean>;
6
+ handler: (runtime: any, message: any, _state: any, _options: any, callback: (response: any) => void) => Promise<void>;
7
+ examples: {
8
+ user: string;
9
+ content: {
10
+ text: string;
11
+ };
12
+ }[][];
13
+ };
14
+ //# sourceMappingURL=pauseResume.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pauseResume.d.ts","sourceRoot":"","sources":["../../src/actions/pauseResume.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB;;;;wBAcF,GAAG,WAAW,GAAG,KAAG,OAAO,CAAC,OAAO,CAAC;uBAoBnD,GAAG,WACH,GAAG,UACJ,GAAG,YACD,GAAG,YACH,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI;;;;;;;CAuDpC,CAAC"}
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pauseResumeAction = void 0;
4
+ const client_factory_1 = require("../client-factory");
5
+ exports.pauseResumeAction = {
6
+ name: "SHIELD_PAUSE_RESUME",
7
+ description: "Pause or resume AgentShield enforcement. When paused, transactions " +
8
+ "pass through without policy checks or spend recording.",
9
+ similes: [
10
+ "pause shield",
11
+ "resume shield",
12
+ "pause enforcement",
13
+ "resume enforcement",
14
+ "disable shield",
15
+ "enable shield",
16
+ ],
17
+ validate: async (runtime, message) => {
18
+ try {
19
+ (0, client_factory_1.getOrCreateShieldedWallet)(runtime);
20
+ }
21
+ catch {
22
+ return false;
23
+ }
24
+ const text = (message.content?.text || "").toLowerCase();
25
+ const keywords = [
26
+ "pause shield",
27
+ "resume shield",
28
+ "pause enforcement",
29
+ "resume enforcement",
30
+ "disable shield",
31
+ "enable shield",
32
+ ];
33
+ return keywords.some((kw) => text.includes(kw));
34
+ },
35
+ handler: async (runtime, message, _state, _options, callback) => {
36
+ try {
37
+ const { wallet } = (0, client_factory_1.getOrCreateShieldedWallet)(runtime);
38
+ const text = (message.content?.text || "").toLowerCase();
39
+ // Determine intent from message text
40
+ const resumeKeywords = ["resume", "enable", "unpause", "activate"];
41
+ const isResume = resumeKeywords.some((kw) => text.includes(kw));
42
+ if (isResume) {
43
+ wallet.resume();
44
+ callback({
45
+ text: "Shield enforcement resumed. Policy checks are active.",
46
+ });
47
+ }
48
+ else {
49
+ wallet.pause();
50
+ callback({
51
+ text: "Shield enforcement paused. Transactions will pass through without policy checks.",
52
+ });
53
+ }
54
+ }
55
+ catch (error) {
56
+ callback({
57
+ text: `Failed to pause/resume shield: ${error.message}`,
58
+ error: true,
59
+ });
60
+ }
61
+ },
62
+ examples: [
63
+ [
64
+ {
65
+ user: "{{user1}}",
66
+ content: { text: "Pause the shield enforcement" },
67
+ },
68
+ {
69
+ user: "{{agent}}",
70
+ content: {
71
+ text: "Shield enforcement paused. Transactions will pass through without policy checks.",
72
+ },
73
+ },
74
+ ],
75
+ [
76
+ {
77
+ user: "{{user1}}",
78
+ content: { text: "Resume shield enforcement" },
79
+ },
80
+ {
81
+ user: "{{agent}}",
82
+ content: {
83
+ text: "Shield enforcement resumed. Policy checks are active.",
84
+ },
85
+ },
86
+ ],
87
+ ],
88
+ };
89
+ //# sourceMappingURL=pauseResume.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pauseResume.js","sourceRoot":"","sources":["../../src/actions/pauseResume.ts"],"names":[],"mappings":";;;AAAA,sDAA8D;AAEjD,QAAA,iBAAiB,GAAG;IAC/B,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EACT,qEAAqE;QACrE,wDAAwD;IAC1D,OAAO,EAAE;QACP,cAAc;QACd,eAAe;QACf,mBAAmB;QACnB,oBAAoB;QACpB,gBAAgB;QAChB,eAAe;KAChB;IAED,QAAQ,EAAE,KAAK,EAAE,OAAY,EAAE,OAAY,EAAoB,EAAE;QAC/D,IAAI,CAAC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,CAAC;QACH,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,QAAQ,CAAC;gBACP,IAAI,EAAE,kCAAkC,KAAK,CAAC,OAAO,EAAE;gBACvD,KAAK,EAAE,IAAI;aACZ,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,QAAQ,EAAE;QACR;YACE;gBACE,IAAI,EAAE,WAAW;gBACjB,OAAO,EAAE,EAAE,IAAI,EAAE,8BAA8B,EAAE;aAClD;YACD;gBACE,IAAI,EAAE,WAAW;gBACjB,OAAO,EAAE;oBACP,IAAI,EAAE,kFAAkF;iBACzF;aACF;SACF;QACD;YACE;gBACE,IAAI,EAAE,WAAW;gBACjB,OAAO,EAAE,EAAE,IAAI,EAAE,2BAA2B,EAAE;aAC/C;YACD;gBACE,IAAI,EAAE,WAAW;gBACjB,OAAO,EAAE;oBACP,IAAI,EAAE,uDAAuD;iBAC9D;aACF;SACF;KACF;CACF,CAAC"}
@@ -0,0 +1,14 @@
1
+ export declare const statusAction: {
2
+ name: string;
3
+ description: string;
4
+ similes: string[];
5
+ validate: (runtime: any, message: any) => Promise<boolean>;
6
+ handler: (runtime: any, _message: any, _state: any, _options: any, callback: (response: any) => void) => Promise<void>;
7
+ examples: {
8
+ user: string;
9
+ content: {
10
+ text: string;
11
+ };
12
+ }[][];
13
+ };
14
+ //# sourceMappingURL=status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/actions/status.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY;;;;wBAYG,GAAG,WAAW,GAAG,KAAG,OAAO,CAAC,OAAO,CAAC;uBAmBnD,GAAG,YACF,GAAG,UACL,GAAG,YACD,GAAG,YACH,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI;;;;;;;CAoDpC,CAAC"}
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.statusAction = void 0;
4
+ const client_factory_1 = require("../client-factory");
5
+ exports.statusAction = {
6
+ name: "SHIELD_STATUS",
7
+ description: "Show current AgentShield spending summary, rate limit usage, and enforcement state.",
8
+ similes: [
9
+ "shield status",
10
+ "spending status",
11
+ "budget remaining",
12
+ "check spending",
13
+ "how much budget",
14
+ ],
15
+ validate: async (runtime, message) => {
16
+ try {
17
+ (0, client_factory_1.getOrCreateShieldedWallet)(runtime);
18
+ }
19
+ catch {
20
+ return false;
21
+ }
22
+ const text = (message.content?.text || "").toLowerCase();
23
+ const keywords = [
24
+ "shield status",
25
+ "spending",
26
+ "budget",
27
+ "how much left",
28
+ "remaining",
29
+ ];
30
+ return keywords.some((kw) => text.includes(kw));
31
+ },
32
+ handler: async (runtime, _message, _state, _options, callback) => {
33
+ try {
34
+ const { wallet } = (0, client_factory_1.getOrCreateShieldedWallet)(runtime);
35
+ const summary = wallet.getSpendingSummary();
36
+ const lines = [
37
+ `=== AgentShield Status ===`,
38
+ `Enforcement: ${summary.isPaused ? "PAUSED" : "ACTIVE"}`,
39
+ ``,
40
+ ];
41
+ for (const t of summary.tokens) {
42
+ const label = t.symbol ?? t.mint.slice(0, 8) + "...";
43
+ const pct = t.limit > BigInt(0)
44
+ ? Number((t.spent * BigInt(100)) / t.limit)
45
+ : 0;
46
+ lines.push(`${label}: ${t.spent.toString()} / ${t.limit.toString()} (${pct}% used)`);
47
+ lines.push(` Remaining: ${t.remaining.toString()}`);
48
+ }
49
+ lines.push(``, `Rate limit: ${summary.rateLimit.count}/${summary.rateLimit.limit} transactions (${summary.rateLimit.remaining} remaining)`);
50
+ callback({ text: lines.join("\n") });
51
+ }
52
+ catch (error) {
53
+ callback({
54
+ text: `Failed to get shield status: ${error.message}`,
55
+ error: true,
56
+ });
57
+ }
58
+ },
59
+ examples: [
60
+ [
61
+ {
62
+ user: "{{user1}}",
63
+ content: { text: "What's my shield spending status?" },
64
+ },
65
+ {
66
+ user: "{{agent}}",
67
+ content: {
68
+ text: "=== AgentShield Status ===\nEnforcement: ACTIVE\n\nUSDC: 200000000 / 500000000 (40% used)\n Remaining: 300000000",
69
+ },
70
+ },
71
+ ],
72
+ ],
73
+ };
74
+ //# sourceMappingURL=status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/actions/status.ts"],"names":[],"mappings":";;;AAAA,sDAA8D;AAEjD,QAAA,YAAY,GAAG;IAC1B,IAAI,EAAE,eAAe;IACrB,WAAW,EACT,qFAAqF;IACvF,OAAO,EAAE;QACP,eAAe;QACf,iBAAiB;QACjB,kBAAkB;QAClB,gBAAgB;QAChB,iBAAiB;KAClB;IAED,QAAQ,EAAE,KAAK,EAAE,OAAY,EAAE,OAAY,EAAoB,EAAE;QAC/D,IAAI,CAAC;YACH,IAAA,0CAAyB,EAAC,OAAO,CAAC,CAAC;QACrC,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;QAED,MAAM,IAAI,GAAG,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;QACzD,MAAM,QAAQ,GAAG;YACf,eAAe;YACf,UAAU;YACV,QAAQ;YACR,eAAe;YACf,WAAW;SACZ,CAAC;QACF,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;IAClD,CAAC;IAED,OAAO,EAAE,KAAK,EACZ,OAAY,EACZ,QAAa,EACb,MAAW,EACX,QAAa,EACb,QAAiC,EACjC,EAAE;QACF,IAAI,CAAC;YACH,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,0CAAyB,EAAC,OAAO,CAAC,CAAC;YACtD,MAAM,OAAO,GAAG,MAAM,CAAC,kBAAkB,EAAE,CAAC;YAE5C,MAAM,KAAK,GAAG;gBACZ,4BAA4B;gBAC5B,gBAAgB,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,C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O,EAAE,EAAE,IAAI,EAAE,mCAAmC,EAAE;aACvD;YACD;gBACE,IAAI,EAAE,WAAW;gBACjB,OAAO,EAAE;oBACP,IAAI,EAAE,mHAAmH;iBAC1H;aACF;SACF;KACF;CACF,CAAC"}
@@ -0,0 +1,14 @@
1
+ export declare const transactionHistoryAction: {
2
+ name: string;
3
+ description: string;
4
+ similes: string[];
5
+ validate: (runtime: any, message: any) => Promise<boolean>;
6
+ handler: (runtime: any, _message: any, _state: any, _options: any, callback: (response: any) => void) => Promise<void>;
7
+ examples: {
8
+ user: string;
9
+ content: {
10
+ text: string;
11
+ };
12
+ }[][];
13
+ };
14
+ //# sourceMappingURL=transactionHistory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transactionHistory.d.ts","sourceRoot":"","sources":["../../src/actions/transactionHistory.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,wBAAwB;;;;wBAaT,GAAG,WAAW,GAAG,KAAG,OAAO,CAAC,OAAO,CAAC;uBAmBnD,GAAG,YACF,GAAG,UACL,GAAG,YACD,GAAG,YACH,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI;;;;;;;CAgEpC,CAAC"}
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.transactionHistoryAction = void 0;
4
+ const client_factory_1 = require("../client-factory");
5
+ exports.transactionHistoryAction = {
6
+ name: "SHIELD_TRANSACTION_HISTORY",
7
+ description: "Show recent AgentShield transaction activity — per-token usage " +
8
+ "percentages and rate limit status.",
9
+ similes: [
10
+ "transaction history",
11
+ "recent activity",
12
+ "shield history",
13
+ "spending history",
14
+ "activity log",
15
+ ],
16
+ validate: async (runtime, message) => {
17
+ try {
18
+ (0, client_factory_1.getOrCreateShieldedWallet)(runtime);
19
+ }
20
+ catch {
21
+ return false;
22
+ }
23
+ const text = (message.content?.text || "").toLowerCase();
24
+ const keywords = [
25
+ "transaction history",
26
+ "recent activity",
27
+ "shield history",
28
+ "spending history",
29
+ "activity log",
30
+ ];
31
+ return keywords.some((kw) => text.includes(kw));
32
+ },
33
+ handler: async (runtime, _message, _state, _options, callback) => {
34
+ try {
35
+ const { wallet } = (0, client_factory_1.getOrCreateShieldedWallet)(runtime);
36
+ const summary = wallet.getSpendingSummary();
37
+ const lines = [
38
+ `=== AgentShield Transaction History ===`,
39
+ `Enforcement: ${summary.isPaused ? "PAUSED" : "ACTIVE"}`,
40
+ ``,
41
+ `--- Per-Token Usage ---`,
42
+ ];
43
+ if (summary.tokens.length === 0) {
44
+ lines.push("No spending limits configured.");
45
+ }
46
+ else {
47
+ for (const t of summary.tokens) {
48
+ const label = t.symbol ?? t.mint.slice(0, 8) + "...";
49
+ const pct = t.limit > BigInt(0)
50
+ ? Number((t.spent * BigInt(100)) / t.limit)
51
+ : 0;
52
+ const windowHrs = t.windowMs / 3600000;
53
+ lines.push(` ${label}:`);
54
+ lines.push(` Spent: ${t.spent.toString()} / ${t.limit.toString()}`);
55
+ lines.push(` Usage: ${pct}%`);
56
+ lines.push(` Remaining: ${t.remaining.toString()}`);
57
+ lines.push(` Window: ${windowHrs}h rolling`);
58
+ }
59
+ }
60
+ lines.push("", `--- Rate Limit ---`);
61
+ lines.push(` Transactions: ${summary.rateLimit.count} / ${summary.rateLimit.limit}`);
62
+ lines.push(` Remaining: ${summary.rateLimit.remaining}`);
63
+ const rlWindowHrs = summary.rateLimit.windowMs / 3600000;
64
+ lines.push(` Window: ${rlWindowHrs}h`);
65
+ callback({ text: lines.join("\n") });
66
+ }
67
+ catch (error) {
68
+ callback({
69
+ text: `Failed to get transaction history: ${error.message}`,
70
+ error: true,
71
+ });
72
+ }
73
+ },
74
+ examples: [
75
+ [
76
+ {
77
+ user: "{{user1}}",
78
+ content: { text: "Show me the transaction history" },
79
+ },
80
+ {
81
+ user: "{{agent}}",
82
+ content: {
83
+ text: "=== AgentShield Transaction History ===\nEnforcement: ACTIVE\n\n--- Per-Token Usage ---\n USDC:\n Spent: 200000000 / 500000000\n Usage: 40%\n Remaining: 300000000\n Window: 24h rolling",
84
+ },
85
+ },
86
+ ],
87
+ ],
88
+ };
89
+ //# sourceMappingURL=transactionHistory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transactionHistory.js","sourceRoot":"","sources":["../../src/actions/transactionHistory.ts"],"names":[],"mappings":";;;AAAA,sDAA8D;AAEjD,QAAA,wBAAwB,GAAG;IACtC,IAAI,EAAE,4BAA4B;IAClC,WAAW,EACT,iEAAiE;QACjE,oCAAoC;IACtC,OAAO,EAAE;QACP,qBAAqB;QACrB,iBAAiB;QACjB,gBAAgB;QAChB,kBAAkB;QAClB,cAAc;KACf;IAED,QAAQ,EAAE,KAAK,EAAE,OAAY,EAAE,OAAY,EAAoB,EAAE;QAC/D,IAAI,CAAC;YACH,IAAA,0CAAyB,EAAC,OAAO,CAAC,CAAC;QACrC,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;QAED,MAAM,IAAI,GAAG,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;QACzD,MAAM,QAAQ,GAAG;YACf,qBAAqB;YACrB,iBAAiB;YACjB,gBAAgB;YAChB,kBAAkB;YAClB,cAAc;SACf,CAAC;QACF,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;IAClD,CAAC;IAED,OAAO,EAAE,KAAK,EACZ,OAAY,EACZ,QAAa,EACb,MAAW,EACX,QAAa,EACb,QAAiC,EACjC,EAAE;QACF,IAAI,CAAC;YACH,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,0CAAyB,EAAC,OAAO,CAAC,CAAC;YACtD,MAAM,OAAO,GAAG,MAAM,CAAC,kBAAkB,EAAE,CAAC;YAE5C,MAAM,KAAK,GAAG;gBACZ,yCAAyC;gBACzC,gBAAgB,OAAO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