@wzrd_sol/eliza-plugin 0.9.0 → 0.10.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.
package/README.md CHANGED
@@ -75,7 +75,7 @@ npm install @wzrd_sol/eliza-plugin
75
75
 
76
76
  Classification uses the verifier domain allowlist only. Envelope `version` / `kind` cannot promote a V6 body to V7.
77
77
 
78
- `verifyReceipt` and `getIntelClient().verify` are **synchronous**. They do not accept `fetchPubkey` / `apiBase` (0.6.1 SDK path) and return `receiptVersion` + `freshness` instead of SDK `leafVersion`. Default signing key is `CURRENT_RECEIPT_PUBKEY` (v2). Do not pass SDK `TRUSTED_RECEIPT_PUBKEY` (v1) or live V7 receipts fail closed.
78
+ `verifyReceipt` and `getIntelClient().verify` are **synchronous**. They do not accept `fetchPubkey` / `apiBase` (0.6.1 SDK path) and return `receiptVersion` + `freshness` instead of SDK `leafVersion`. Default signing key is `CURRENT_RECEIPT_PUBKEY` (v2). The re-exported SDK `TRUSTED_RECEIPT_PUBKEY` is the same v2 key from 0.10.0 on. The legacy v1 key (`LEGACY_RECEIPT_PUBKEYS[0]` in `@wzrd_sol/sdk`) fails live V7 receipts closed.
79
79
 
80
80
  ### Preflight (free, no wallet)
81
81
 
@@ -128,7 +128,7 @@ const agent = new AgentRuntime({ plugins: [wzrdPlugin] });
128
128
  `payWrap` receives the **guarded** fetch. Opt out with `TWZRD_AUTO_GATE=0` or `{ disabled: true }`.
129
129
  Lookups carry `X-TWZRD-Integration: eliza-plugin/<version>` unless you pass your own `attribution`.
130
130
 
131
- On `twzrd-x402-gate` 0.13.1 the guard refuses each of these before `payWrap` signs:
131
+ On `twzrd-x402-gate` 0.14.0 the guard refuses each of these before `payWrap` signs (the 0.13 defaults, unchanged in 0.14.0):
132
132
 
133
133
  | Refused by default | Reason | Opt out (restores the 0.12.5 outcome) |
134
134
  |---|---|---|
@@ -154,6 +154,35 @@ const agent = new AgentRuntime({ plugins: [wzrdPlugin] });
154
154
 
155
155
  Without a paying fetch, `WZRD_INTEL_TRUST` returns the HTTP 402 requirements.
156
156
 
157
+ ## 0.10.1 changes
158
+
159
+ - `verifyReceipt` and `getIntelClient().verify` report `freshnessUnauthenticated: false` only when the
160
+ verify passes. `twzrd-receipt-verifier` 1.4.4 reports `freshness_unauthenticated: false` for any V7
161
+ domain, even when it rejects the receipt, and 0.10.0 passed that through: a rejected V7 receipt read
162
+ `valid: false` with `freshnessUnauthenticated: false`. `valid` and `freshness` (`unauthenticated`) were
163
+ already correct there; only that flag was wrong.
164
+ - Dependency ranges and the `twzrd-x402-gate` `0.14.0` pin are unchanged. `X-Twzrd-Caller` reads
165
+ `eliza-plugin/0.10.1@0.14.0`.
166
+
167
+ ## 0.10.0 changes
168
+
169
+ - Depends on `@wzrd_sol/sdk` `^0.5.1` (was `^0.4.8`) and on `twzrd-x402-gate` exactly `0.14.0` (was `0.13.1`),
170
+ the first gate release that exports `createDemandDeskWallet`. The guard's refusal defaults are those of
171
+ 0.13.1. Fetches this plugin owns stamp `X-Twzrd-Caller: eliza-plugin/<version>@0.14.0`.
172
+ - The re-exported `TRUSTED_RECEIPT_PUBKEY` is now the v2 receipt key, equal to `CURRENT_RECEIPT_PUBKEY`.
173
+ It was the v1 key. If you verify old v1-signed receipts, pass `LEGACY_RECEIPT_PUBKEYS[0]` from
174
+ `@wzrd_sol/sdk` explicitly.
175
+ - A preflight answer without a known decision is now an error (`preflight_invalid_payload`), not a
176
+ result. `WZRD_INTEL_TRUST` refuses with no spend; SDK 0.4 read such an answer as `warn` and let the
177
+ paid lookup go ahead. `WZRD_INTEL_PREFLIGHT` returns `refuse_pay: true` (`preflight_unavailable`)
178
+ where it used to report the answer as a card. `getIntelClient().preflight` rejects instead of
179
+ resolving.
180
+ - No new paid call. SDK 0.5's `preSpendGate` can escalate to the paid quick lookup, but only when
181
+ `escalateAboveUsdc` is set, and this plugin does not set it.
182
+ - Adds `createDemandDeskWalletProvider` and `createWzrdPlugin({ walletProvider })`: a guarded
183
+ Demand Desk wallet provider for host spend actions, built on `twzrd-x402-gate`'s
184
+ `createDemandDeskWallet`.
185
+
157
186
  ## 0.9.0 changes
158
187
 
159
188
  - Depends on `twzrd-x402-gate` exactly `0.13.1` (was `0.12.5`). Fetches this plugin owns stamp
@@ -0,0 +1,18 @@
1
+ import { type DemandDeskWalletAdapter } from 'twzrd-x402-gate';
2
+ import type { Provider } from '@elizaos/core';
3
+ /** Host wallet provider for spend actions. Keep the raw adapter private; actions
4
+ * receive only this facade. The intel-only plugin has no wallet to replace and
5
+ * cannot intercept unrelated third-party plugins that retain their own keys. */
6
+ export declare function createDemandDeskWalletProvider<T>(adapter: DemandDeskWalletAdapter<T>): Readonly<{
7
+ name: "TWZRD_DEMAND_DESK_WALLET";
8
+ description: "Guarded wallet capability for host spend actions under Demand Desk authorization.";
9
+ get: Provider["get"];
10
+ getWallet: () => Readonly<{
11
+ signTransaction: (tx: T, context: import("twzrd-x402-gate").DemandDeskWalletContext) => Promise<T>;
12
+ signAllTransactions(items: readonly {
13
+ transaction: T;
14
+ context: import("twzrd-x402-gate").DemandDeskWalletContext;
15
+ }[]): Promise<T[]>;
16
+ signAndSendTransaction(tx: T, context: import("twzrd-x402-gate").DemandDeskWalletContext): Promise<string>;
17
+ }>;
18
+ }>;
@@ -0,0 +1,17 @@
1
+ import { createDemandDeskWallet } from 'twzrd-x402-gate';
2
+ /** Host wallet provider for spend actions. Keep the raw adapter private; actions
3
+ * receive only this facade. The intel-only plugin has no wallet to replace and
4
+ * cannot intercept unrelated third-party plugins that retain their own keys. */
5
+ export function createDemandDeskWalletProvider(adapter) {
6
+ const wallet = createDemandDeskWallet(adapter);
7
+ return Object.freeze({
8
+ name: 'TWZRD_DEMAND_DESK_WALLET',
9
+ description: 'Guarded wallet capability for host spend actions under Demand Desk authorization.',
10
+ get: (async () => ({
11
+ text: 'Spend actions must use the configured Demand Desk wallet capability.',
12
+ data: { wallet },
13
+ values: { demandDeskWalletRequired: true },
14
+ })),
15
+ getWallet: () => wallet,
16
+ });
17
+ }
package/dist/index.d.ts CHANGED
@@ -9,13 +9,16 @@
9
9
  *
10
10
  * 0.8.0 removed the retired earn actions (infer/report/earn/claim/rewards).
11
11
  */
12
- import type { Action, Plugin } from '@elizaos/core';
12
+ import type { Action, Plugin, Provider } from '@elizaos/core';
13
13
  import { intelPreflightAction } from './actions/intel-preflight.js';
14
14
  import { merchantCardAction } from './actions/merchant-card.js';
15
15
  import { intelTrustAction } from './actions/intel-trust.js';
16
16
  import { verifyReceiptAction } from './actions/verify-receipt.js';
17
+ export { createDemandDeskWalletProvider } from './demand-desk-wallet.js';
17
18
  export declare const intelActions: Action[];
18
- export declare function createWzrdPlugin(): Plugin;
19
+ export declare function createWzrdPlugin(options?: {
20
+ walletProvider?: Provider;
21
+ }): Plugin;
19
22
  /** Default plugin: intel actions only (0.6+). */
20
23
  export declare const wzrdPlugin: Plugin;
21
24
  export default wzrdPlugin;
@@ -24,7 +27,7 @@ export { getIntelApiBase, getIntelClient } from './client-factory.js';
24
27
  export { setPayingFetch, clearPayingFetch, resolvePayingFetch, installTwzrdAutoGate, autoGateOptions, withTracking, callerTag, GATE_PIN, } from './paying-fetch.js';
25
28
  export { refusePacket, paidLookupConfirmed } from './actions/intel-trust.js';
26
29
  export type { RefusePacket } from './actions/intel-trust.js';
27
- /** SDK intel helpers. TRUSTED_RECEIPT_PUBKEY is the v1 key — use CURRENT_RECEIPT_PUBKEY for V7 verify. */
30
+ /** SDK intel helpers. From SDK 0.5, TRUSTED_RECEIPT_PUBKEY is the v2 key, equal to CURRENT_RECEIPT_PUBKEY. */
28
31
  export { IntelPaymentRequiredError, intelPreflight, fetchIntelTrust, fetchMerchantCard, preSpendGate, intelTrustUrl, TRUSTED_RECEIPT_PUBKEY, INTEL_TRUST_PRICE_USDC, } from '@wzrd_sol/sdk';
29
32
  export { verifyReceipt, classifyReceipt, describeReceiptSurface, freshnessStatusFor, freshnessFromVerify, formatVerifyResult, CURRENT_RECEIPT_PUBKEY, CURRENT_RECEIPT_KEY_ID, REPUTATION_V5_DOMAIN, REPUTATION_V6_DOMAIN, REPUTATION_V7_DOMAIN, } from './receipt-verify.js';
30
33
  export type { VerifyReceiptResult, VerifyReceiptOptions, TwzrdReceiptLike, ReceiptVersion, FreshnessStatus, } from './receipt-verify.js';
package/dist/index.js CHANGED
@@ -2,6 +2,7 @@ import { intelPreflightAction } from './actions/intel-preflight.js';
2
2
  import { merchantCardAction } from './actions/merchant-card.js';
3
3
  import { intelTrustAction } from './actions/intel-trust.js';
4
4
  import { verifyReceiptAction } from './actions/verify-receipt.js';
5
+ export { createDemandDeskWalletProvider } from './demand-desk-wallet.js';
5
6
  export const intelActions = [
6
7
  intelPreflightAction,
7
8
  merchantCardAction,
@@ -13,11 +14,12 @@ const INTEL_DESCRIPTION = 'TWZRD Agent Intel — free ReadinessCard preflight +
13
14
  'offline verify via twzrd-receipt-verifier. ' +
14
15
  'Legacy V6 verification is labeled freshness=derived_from_timestamp. ' +
15
16
  'Buyer sequence is call-site / action-driven (not an auto-interceptor of all payments).';
16
- export function createWzrdPlugin() {
17
+ export function createWzrdPlugin(options = {}) {
17
18
  return {
18
19
  name: 'wzrd',
19
20
  description: INTEL_DESCRIPTION,
20
21
  actions: [...intelActions],
22
+ ...(options.walletProvider ? { providers: [options.walletProvider] } : {}),
21
23
  };
22
24
  }
23
25
  /** Default plugin: intel actions only (0.6+). */
@@ -27,6 +29,6 @@ export { intelPreflightAction, merchantCardAction, intelTrustAction, verifyRecei
27
29
  export { getIntelApiBase, getIntelClient } from './client-factory.js';
28
30
  export { setPayingFetch, clearPayingFetch, resolvePayingFetch, installTwzrdAutoGate, autoGateOptions, withTracking, callerTag, GATE_PIN, } from './paying-fetch.js';
29
31
  export { refusePacket, paidLookupConfirmed } from './actions/intel-trust.js';
30
- /** SDK intel helpers. TRUSTED_RECEIPT_PUBKEY is the v1 key — use CURRENT_RECEIPT_PUBKEY for V7 verify. */
32
+ /** SDK intel helpers. From SDK 0.5, TRUSTED_RECEIPT_PUBKEY is the v2 key, equal to CURRENT_RECEIPT_PUBKEY. */
31
33
  export { IntelPaymentRequiredError, intelPreflight, fetchIntelTrust, fetchMerchantCard, preSpendGate, intelTrustUrl, TRUSTED_RECEIPT_PUBKEY, INTEL_TRUST_PRICE_USDC, } from '@wzrd_sol/sdk';
32
34
  export { verifyReceipt, classifyReceipt, describeReceiptSurface, freshnessStatusFor, freshnessFromVerify, formatVerifyResult, CURRENT_RECEIPT_PUBKEY, CURRENT_RECEIPT_KEY_ID, REPUTATION_V5_DOMAIN, REPUTATION_V6_DOMAIN, REPUTATION_V7_DOMAIN, } from './receipt-verify.js';
@@ -3,7 +3,7 @@ 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.13.1";
6
+ export declare const GATE_PIN = "0.14.0";
7
7
  export declare function integrationTag(): string;
8
8
  /** Seat stamp: X-Twzrd-Caller eliza-plugin/<version>@<GATE_PIN>. */
9
9
  export declare function callerTag(): string;
@@ -6,7 +6,7 @@ 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.13.1';
9
+ export const GATE_PIN = '0.14.0';
10
10
  export function integrationTag() {
11
11
  return `eliza-plugin/${PLUGIN_VERSION}`;
12
12
  }
@@ -1,12 +1,13 @@
1
1
  /**
2
2
  * V7-capable receipt verification for the Eliza plugin.
3
3
  *
4
- * `@wzrd_sol/sdk` (through 0.4.8) only knows V5/V6 leaf bindings and defaults
5
- * to the legacy v1 signing key. Current paid trust issues V7 receipts that bind
6
- * freshness into the leaf and are signed with twzrd-receipt-ed25519-v2.
4
+ * Current paid trust issues V7 receipts that bind freshness into the leaf and
5
+ * are signed with twzrd-receipt-ed25519-v2. `@wzrd_sol/sdk` 0.5 also verifies
6
+ * V7, but its `verifyReceipt` is async and reports only `leafVersion`.
7
7
  *
8
- * This module routes through `twzrd-receipt-verifier@^1.4.0` and labels V6
9
- * results with the downgraded freshness status from docs/receipt-v6-spec.md.
8
+ * This module stays synchronous, routes through `twzrd-receipt-verifier@^1.4.0`,
9
+ * labels the version from the domain allowlist, and labels V6 results with the
10
+ * downgraded freshness status from docs/receipt-v6-spec.md.
10
11
  */
11
12
  import { createRequire } from 'node:module';
12
13
  export const REPUTATION_V5_DOMAIN = 'TWZRD:AO_REPUTATION_RECEIPT_V5';
@@ -109,8 +110,11 @@ export function verifyReceipt(receipt, opts = {}) {
109
110
  const raw = verifier.verify(receipt, trustedPubkey, {
110
111
  maxAgeSeconds: opts.maxAgeSeconds,
111
112
  });
112
- // Fail closed: a verifier early-return (kind/version mismatch) omits the flag.
113
- const freshnessUnauthenticated = raw.freshness_unauthenticated !== false;
113
+ // Fail closed: freshness is authenticated only on a passing verify. The
114
+ // verifier's flag describes the domain's leaf layout: 1.4.0 omitted it on an
115
+ // early return (kind/version mismatch), but 1.4.4 classifies the domain first
116
+ // and reports false for any V7 domain, even when it rejects the receipt.
117
+ const freshnessUnauthenticated = !(raw.valid === true && raw.freshness_unauthenticated === false);
114
118
  const result = {
115
119
  valid: !!raw.valid,
116
120
  leafValid: !!raw.leaf_valid,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wzrd_sol/eliza-plugin",
3
- "version": "0.9.0",
3
+ "version": "0.10.1",
4
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",
@@ -18,9 +18,9 @@
18
18
  "typecheck": "echo 'eliza-plugin: typecheck ok'"
19
19
  },
20
20
  "dependencies": {
21
- "@wzrd_sol/sdk": "^0.4.8",
21
+ "@wzrd_sol/sdk": "^0.5.1",
22
22
  "twzrd-receipt-verifier": "^1.4.0",
23
- "twzrd-x402-gate": "0.13.1"
23
+ "twzrd-x402-gate": "0.14.0"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "@elizaos/core": "^1.0.0"