@stellar-agent/policy 0.4.2 → 0.4.3

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 (2) hide show
  1. package/README.md +43 -0
  2. package/package.json +4 -4
package/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # @stellar-agent/policy
2
+
3
+ Deterministic policy parsing and decision logic for Stellar Agent workflows.
4
+
5
+ This package evaluates payment requests, Blend DeFi requests, Aquarius AMM preflight requests, and core Stellar liquidity-pool requests against explicit policy controls.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install @stellar-agent/policy
11
+ ```
12
+
13
+ ## Example
14
+
15
+ ```js
16
+ import { defaultPolicyForNetwork, evaluatePaymentRequest } from "@stellar-agent/policy";
17
+
18
+ const policy = defaultPolicyForNetwork("testnet");
19
+ const decision = evaluatePaymentRequest(policy, {
20
+ network: "testnet",
21
+ destination: "G...",
22
+ amount: "1",
23
+ asset: "XLM",
24
+ spendHistory: { dailyTotal: "0", monthlyTotal: "0", knownRecipients: [], knownDomains: [] }
25
+ });
26
+ ```
27
+
28
+ ## Policy Areas
29
+
30
+ - Payment limits, allowed assets, recipients, and domains.
31
+ - Blend pool, request-type, borrow, exposure, health-factor, and simulation rules.
32
+ - Aquarius pool, asset, action, exposure, and slippage-bound rules.
33
+ - Core liquidity-pool asset, action, exposure, and price-bound rules.
34
+
35
+ ## Safety
36
+
37
+ Policy evaluation is prompt-independent and should run before signing or submission. Mainnet decisions are approval-gated by default.
38
+
39
+ ## Links
40
+
41
+ - GitHub: https://github.com/someone-in-texas/Stellar-Agent
42
+ - Threat model: https://github.com/someone-in-texas/Stellar-Agent/blob/main/docs/threat-model.md
43
+ - Mainnet safety: https://github.com/someone-in-texas/Stellar-Agent/blob/main/docs/mainnet-safety.md
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stellar-agent/policy",
3
- "version": "0.4.2",
4
- "description": "Deterministic policy parsing and payment decision logic for Stellar Agent Bridge.",
3
+ "version": "0.4.3",
4
+ "description": "Deterministic policy parsing and payment, DeFi, and market decision logic for Stellar Agent Bridge.",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -12,7 +12,7 @@
12
12
  "bugs": {
13
13
  "url": "https://github.com/someone-in-texas/Stellar-Agent/issues"
14
14
  },
15
- "homepage": "https://github.com/someone-in-texas/Stellar-Agent#readme",
15
+ "homepage": "https://github.com/someone-in-texas/Stellar-Agent/tree/main/packages/policy#readme",
16
16
  "engines": {
17
17
  "node": ">=22"
18
18
  },
@@ -32,7 +32,7 @@
32
32
  "test": "vitest run"
33
33
  },
34
34
  "dependencies": {
35
- "@stellar-agent/core": "0.4.2",
35
+ "@stellar-agent/core": "0.4.3",
36
36
  "yaml": "^2.7.1",
37
37
  "zod": "^3.25.46"
38
38
  }