@wzrd_sol/eliza-plugin 0.8.0 → 0.9.0

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/README.md CHANGED
@@ -19,8 +19,12 @@ Before any x402 spend:
19
19
  3. **Optional paid trust** - `WZRD_INTEL_TRUST` (~0.05 USDC) - full score + **signed V7 receipt**
20
20
  4. **Offline verify** - `WZRD_VERIFY_RECEIPT` via `twzrd-receipt-verifier`
21
21
 
22
- This plugin exposes **actions + SDK helpers**. It does **not** auto-intercept every wallet signature.
23
- Wire `preSpendGate` / actions into your spend path, or compose with standalone `twzrd-x402-gate` on a paying fetch.
22
+ This plugin exposes **actions + SDK helpers**. The free checks above do not enforce anything by
23
+ themselves: an action refuses only its own paid lookup, and nothing here intercepts a signature your
24
+ agent makes elsewhere. **`installTwzrdAutoGate` is what enforces.** It guards the raw fetch before your
25
+ x402 client's `payWrap` signs, so a payment made through the plugin's paying fetch is checked first
26
+ (see [Guard pattern](#guard-pattern-installtwzrdautogate)). A spend path that does not go through that
27
+ fetch needs its own gate, such as `preSpendGate` or standalone `twzrd-x402-gate`.
24
28
 
25
29
  ## 3-line quickstart
26
30
 
@@ -124,6 +128,17 @@ const agent = new AgentRuntime({ plugins: [wzrdPlugin] });
124
128
  `payWrap` receives the **guarded** fetch. Opt out with `TWZRD_AUTO_GATE=0` or `{ disabled: true }`.
125
129
  Lookups carry `X-TWZRD-Integration: eliza-plugin/<version>` unless you pass your own `attribution`.
126
130
 
131
+ On `twzrd-x402-gate` 0.13.1 the guard refuses each of these before `payWrap` signs:
132
+
133
+ | Refused by default | Reason | Opt out (restores the 0.12.5 outcome) |
134
+ |---|---|---|
135
+ | A merchant card that has not fully answered the wash question, including a wallet intel has never seen | `twzrd_wash_unknown` | `{ refuseWashUnknown: false }` or `TWZRD_REFUSE_WASH_UNKNOWN=0` |
136
+ | An evaluated `warn` with no `recommended_cap_usdc`, or at an unknown price | `twzrd_warn_no_cap`, `twzrd_warn_unknown_price` | `{ refuseUncappedWarn: false }` or `TWZRD_REFUSE_UNCAPPED_WARN=0` |
137
+ | A seller intel has never evaluated (`score: null` or `null_reason` set), even within its cap | `twzrd_unevaluated_subject_<null_reason>` | `{ refuseUnevaluated: false }` or `TWZRD_REFUSE_UNEVALUATED=0` |
138
+
139
+ An unreachable card is still an outage, decided by `failOpen`. The env opt-outs also accept
140
+ `false`, `no` and `off`; any other value leaves the refusal on.
141
+
127
142
  ### Paid trust receipt
128
143
 
129
144
  ```typescript
@@ -139,14 +154,26 @@ const agent = new AgentRuntime({ plugins: [wzrdPlugin] });
139
154
 
140
155
  Without a paying fetch, `WZRD_INTEL_TRUST` returns the HTTP 402 requirements.
141
156
 
157
+ ## 0.9.0 changes
158
+
159
+ - Depends on `twzrd-x402-gate` exactly `0.13.1` (was `0.12.5`). Fetches this plugin owns stamp
160
+ `X-Twzrd-Caller: eliza-plugin/<version>@0.13.1`.
161
+ - `installTwzrdAutoGate` now refuses more before your pay client signs: an unanswered wash question,
162
+ an uncapped or unpriced `warn`, and a seller intel has never evaluated. The table under
163
+ [Guard pattern](#guard-pattern-installtwzrdautogate) lists each reason and its opt-out.
164
+ - The actions' own checks are unchanged. `WZRD_INTEL_TRUST` still runs the SDK's `preSpendGate`, which
165
+ refuses `wash_flagged: true` and a missing merchant card, and reports incomplete wash coverage
166
+ without refusing it. When the paying fetch comes from `installTwzrdAutoGate`, the paid call itself
167
+ also goes through the guard above.
168
+
142
169
  ## 0.8.0 changes (breaking)
143
170
 
144
171
  - Removed the retired earn actions, `legacyEarnActions`, `wzrdPluginWithLegacyEarn`, `WzrdClient`,
145
172
  `getWzrdClient` and `clearClientCache`. The plugin no longer reads `SOLANA_PRIVATE_KEY` or `WZRD_API_URL`.
146
173
  - `WZRD_INTEL_TRUST` spends only with `WZRD_INTEL_ALLOW_PAID=true` or `confirm_spend: true`.
147
174
  - `WZRD_MERCHANT_CARD` is fail-closed when the card is unavailable (`refuse_pay: true`).
148
- - A paid trust lookup also refuses, with no spend, when that card lookup does not answer. A card that answers with incomplete wash coverage is reported, not refused, on gate 0.12.0 (`refuseWashUnknown` stays opt-in until 0.13.0).
149
- - Depends on `twzrd-x402-gate` exactly `0.12.0`. Fetches this plugin owns stamp `X-Twzrd-Caller: eliza-plugin/<version>@0.12.0`.
175
+ - A paid trust lookup also refuses, with no spend, when that card lookup does not answer. A card that answers with incomplete wash coverage is reported, not refused (0.9.0 keeps this for the action's own check).
176
+ - Depended on `twzrd-x402-gate` exactly `0.12.5`. 0.9.0 moves the pin to `0.13.1`.
150
177
 
151
178
  ## Programmatic SDK usage
152
179
 
@@ -85,7 +85,8 @@ export const intelTrustAction = {
85
85
  };
86
86
  }
87
87
  // The SDK returns allow=true with merchantCard=null when the card lookup
88
- // cannot finish. 0.12.0 does not refuse unknown coverage; a missing card does.
88
+ // cannot finish. The SDK's preSpendGate refuses only wash_flagged=true, not
89
+ // incomplete coverage; a missing card does refuse here.
89
90
  if (gate.merchantCard == null) {
90
91
  await callback?.({
91
92
  text: `Merchant card unavailable for ${pubkey}, so the wash check could not finish. ` +
@@ -47,7 +47,7 @@ function formatMerchantCard(card, coverage) {
47
47
  lines.push('Policy: do not pay this pay_to (trustless default). Cap only if operator set washMaxUsdc.');
48
48
  }
49
49
  else if (card.wash_flagged !== false || !coverage.coverageFull) {
50
- lines.push('Wash status unknown: not a clean bill. Strict hosts (twzrd-x402-gate refuseWashUnknown) refuse this pay_to.');
50
+ lines.push('Wash status unknown: not a clean bill. twzrd-x402-gate 0.13 refuses this pay_to by default (refuseWashUnknown).');
51
51
  }
52
52
  return lines.join('\n');
53
53
  }
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @wzrd_sol/eliza-plugin-source — V7-migrated WZRD Agent Intel for ElizaOS
2
+ * @wzrd_sol/eliza-plugin-source — V7-migrated TWZRD Agent Intel for ElizaOS
3
3
  *
4
4
  * Intel lane (default https://intel.twzrd.xyz):
5
5
  * WZRD_INTEL_PREFLIGHT → WZRD_MERCHANT_CARD → WZRD_INTEL_TRUST → WZRD_VERIFY_RECEIPT
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ export const intelActions = [
8
8
  intelTrustAction,
9
9
  verifyReceiptAction,
10
10
  ];
11
- const INTEL_DESCRIPTION = 'WZRD Agent Intel — free ReadinessCard preflight + free merchant_card wash refuse (default), ' +
11
+ const INTEL_DESCRIPTION = 'TWZRD Agent Intel — free ReadinessCard preflight + free merchant_card wash refuse (default), ' +
12
12
  'then optional x402-paid V7 trust receipt (~0.05 USDC, needs WZRD_INTEL_ALLOW_PAID or confirm_spend) + ' +
13
13
  'offline verify via twzrd-receipt-verifier. ' +
14
14
  'Legacy V6 verification is labeled freshness=derived_from_timestamp. ' +
@@ -3,9 +3,9 @@ import { type InstallAutoGateOptions, type PayWrap } from 'twzrd-x402-gate';
3
3
  /** This package's version, stamped into X-TWZRD-Integration on gate lookups. */
4
4
  export declare const PLUGIN_VERSION: string;
5
5
  /** Exact twzrd-x402-gate pin. A caret would float onto a later line. */
6
- export declare const GATE_PIN = "0.12.0";
6
+ export declare const GATE_PIN = "0.13.1";
7
7
  export declare function integrationTag(): string;
8
- /** Seat stamp: X-Twzrd-Caller eliza-plugin/<version>@0.12.0. */
8
+ /** Seat stamp: X-Twzrd-Caller eliza-plugin/<version>@<GATE_PIN>. */
9
9
  export declare function callerTag(): string;
10
10
  /**
11
11
  * Stamp the four seat headers on an intel fetch. The SDK's own client header
@@ -6,11 +6,11 @@ const require = createRequire(import.meta.url);
6
6
  /** This package's version, stamped into X-TWZRD-Integration on gate lookups. */
7
7
  export const PLUGIN_VERSION = require('../package.json').version;
8
8
  /** Exact twzrd-x402-gate pin. A caret would float onto a later line. */
9
- export const GATE_PIN = '0.12.0';
9
+ export const GATE_PIN = '0.13.1';
10
10
  export function integrationTag() {
11
11
  return `eliza-plugin/${PLUGIN_VERSION}`;
12
12
  }
13
- /** Seat stamp: X-Twzrd-Caller eliza-plugin/<version>@0.12.0. */
13
+ /** Seat stamp: X-Twzrd-Caller eliza-plugin/<version>@<GATE_PIN>. */
14
14
  export function callerTag() {
15
15
  return `${integrationTag()}@${GATE_PIN}`;
16
16
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wzrd_sol/eliza-plugin",
3
- "version": "0.8.0",
4
- "description": "WZRD Agent Intel for ElizaOS. Free preflight ReadinessCard + merchant_card (wash_flagged refuse default), paid GET /v1/intel/trust (~0.05 USDC) V7 receipt, offline verify via twzrd-receipt-verifier. Paid lookups need WZRD_INTEL_ALLOW_PAID or confirm_spend; merchant_card outages fail closed.",
3
+ "version": "0.9.0",
4
+ "description": "TWZRD Agent Intel for ElizaOS. Free preflight ReadinessCard + merchant_card (wash_flagged refuse default), paid GET /v1/intel/trust (~0.05 USDC) V7 receipt, offline verify via twzrd-receipt-verifier. Paid lookups need WZRD_INTEL_ALLOW_PAID or confirm_spend; merchant_card outages fail closed.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -20,7 +20,7 @@
20
20
  "dependencies": {
21
21
  "@wzrd_sol/sdk": "^0.4.8",
22
22
  "twzrd-receipt-verifier": "^1.4.0",
23
- "twzrd-x402-gate": "0.12.0"
23
+ "twzrd-x402-gate": "0.13.1"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "@elizaos/core": "^1.0.0"