@cra-agent/policy 0.0.1 → 0.0.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 +31 -0
  2. package/package.json +22 -4
package/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # @cra-agent/policy
2
+
3
+ Spend control for an agent that pays. A pure function: give it the policy and the facts, get back allow or the rule that refused. No I/O, no clock, easy to test.
4
+
5
+ ```bash
6
+ npm i @cra-agent/policy
7
+ ```
8
+
9
+ ```ts
10
+ import { evaluatePolicy, parsePolicyString } from "@cra-agent/policy";
11
+
12
+ const policy = parsePolicyString("daily=5,per_seller=0.5,per_payment=0.05,rate=120/60s,deny=evil.example");
13
+ const decision = evaluatePolicy(policy, ctx); // { allow: true } or { allow: false, rule, reason }
14
+ ```
15
+
16
+ | Key | Meaning |
17
+ |---|---|
18
+ | `daily` | USDC per rolling day |
19
+ | `per_seller` | USDC per day to one counterparty |
20
+ | `per_payment` | USDC for a single payment |
21
+ | `rate` | `120/60s`: payments per window |
22
+ | `allow` / `deny` | Hosts or addresses separated by `\|`. `allow=*` lifts the allowlist. |
23
+ | `networks` | CAIP-2 ids the agent may pay on |
24
+ | `identity` | `required` to pay only ERC-8004 verified sellers |
25
+ | `bond` | Minimum seller bond |
26
+
27
+ Unknown keys are an error, not a silent default. Amounts are `Usdc6` from `@cra-agent/accounting`, never floats.
28
+
29
+ ## Part of CRA AGENT
30
+
31
+ Payments for AI agents on [Arc](https://arc.io), Circle's USDC-native L1. Site: [cra-agent.tech](https://cra-agent.tech) · Source: [github.com/giupy997/arcagentx402](https://github.com/giupy997/arcagentx402) · MIT
package/package.json CHANGED
@@ -1,6 +1,20 @@
1
1
  {
2
2
  "name": "@cra-agent/policy",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
+ "description": "Pure spend control for agent payments: daily, per-seller and per-payment caps, rate limit, allow and deny lists.",
5
+ "keywords": [
6
+ "agent-payments",
7
+ "ai-agents",
8
+ "arc",
9
+ "budget",
10
+ "circle",
11
+ "guardrails",
12
+ "limits",
13
+ "micropayments",
14
+ "spending-policy",
15
+ "usdc",
16
+ "x402"
17
+ ],
4
18
  "type": "module",
5
19
  "main": "./dist/index.js",
6
20
  "types": "./dist/index.d.ts",
@@ -14,7 +28,7 @@
14
28
  "build": "tsc -b"
15
29
  },
16
30
  "dependencies": {
17
- "@cra-agent/accounting": "0.0.1"
31
+ "@cra-agent/accounting": "0.0.3"
18
32
  },
19
33
  "files": [
20
34
  "dist",
@@ -26,8 +40,12 @@
26
40
  "license": "MIT",
27
41
  "repository": {
28
42
  "type": "git",
29
- "url": "https://github.com/giupy997/arcagentx402.git",
43
+ "url": "git+https://github.com/giupy997/arcagentx402.git",
30
44
  "directory": "packages/policy"
31
45
  },
32
- "homepage": "https://cra-agent.tech"
46
+ "homepage": "https://cra-agent.tech",
47
+ "bugs": {
48
+ "url": "https://github.com/giupy997/arcagentx402/issues"
49
+ },
50
+ "author": "cra-agent"
33
51
  }