cleanweb-eliza-plugin 1.0.0 โ†’ 1.0.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
@@ -1,28 +1,83 @@
1
- # ๐ŸŒ cleanweb-eliza-plugin
2
-
3
- > **Official CleanWeb Studio & A.GRID Intelligence Plugin for ElizaOS**
4
- > *87% LLM Token Reduction, Fresh Ground-Truth Discovery, and Solana Mainnet x402 Micropayments*
5
-
6
- ---
7
-
8
- ## โšก Features
9
- - ๐Ÿš€ **87% Token Compression**: Strips ads, navigation, and boilerplate from any HTML page.
10
- - โ˜€๏ธ **Solana Native x402 Micropayments**: Instant $0.001 USDC settlement with 0.4s finality.
11
- - ๐Ÿ›ก๏ธ **Zero-Injection Cleansing**: Neutralizes hidden CSS and prompt injection before LLM ingestion.
12
- - ๐Ÿง  **Eliza Brain Priority 0 Dispatch**: Syncs high-impact signals directly to A.GRID HQ.
13
-
14
- ## ๐Ÿ“ฆ Installation
15
- ```bash
16
- npm install cleanweb-eliza-plugin
17
- ```
18
-
19
- ## ๐Ÿ’ป Quick Start
20
- ```typescript
21
- import { cleanWebPlugin } from "cleanweb-eliza-plugin";
22
-
23
- export default {
24
- name: "MyAutonomousAgent",
25
- plugins: [cleanWebPlugin],
26
- ...
27
- };
28
- ```
1
+ # ๐ŸŒ cleanweb-eliza-plugin
2
+
3
+ > **Official CleanWeb Studio & A.GRID Intelligence Plugin for ElizaOS (v2)**
4
+ > *87% LLM Token Reduction, Fresh Ground-Truth Discovery, Dual-Core Security Gate Attestations, and Solana/Multi-Chain x402 Autonomous Micropayments*
5
+
6
+ [![npm version](https://img.shields.io/npm/v/cleanweb-eliza-plugin.svg)](https://www.npmjs.com/package/cleanweb-eliza-plugin)
7
+ [![PyPI Core](https://img.shields.io/pypi/v/x402-cleanweb-agent?label=PyPI%20Core%20%28x402-cleanweb-agent%29&color=blue)](https://pypi.org/project/x402-cleanweb-agent/)
8
+ [![Coinbase AgentKit](https://img.shields.io/npm/v/agentkit-cleanweb?label=agentkit-cleanweb&color=cb3837)](https://www.npmjs.com/package/agentkit-cleanweb)
9
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
10
+
11
+ ---
12
+
13
+ ## ๐Ÿ”— Official CleanWeb Multi-Registry Suite (npm โ†” PyPI Companion Packages)
14
+
15
+ `cleanweb-eliza-plugin` is part of the multi-registry CleanWeb Autonomous Intelligence Suite. Combine the **ElizaOS Plugin (`npm`)** with the **Python Core / MCP Server (`PyPI`)** and **Coinbase AgentKit Provider (`npm`)**:
16
+
17
+ | Registry | Package | Role in Your Agent Stack | Install Command |
18
+ | :---: | :--- | :--- | :--- |
19
+ | **npm** | [**`cleanweb-eliza-plugin`**](https://www.npmjs.com/package/cleanweb-eliza-plugin) | **ElizaOS v2 Plugin** (Solana x402 Micropayments & A.GRID Priority 0 Dispatch) | `npm install cleanweb-eliza-plugin` |
20
+ | **PyPI** | [**`x402-cleanweb-agent`**](https://pypi.org/project/x402-cleanweb-agent/) | **Python Core Engine, Claude/Cursor MCP Server & Dual-Core Eliza Brain** | `pip install x402-cleanweb-agent` *(or `uvx x402-cleanweb-agent`)* |
21
+ | **npm** | [**`agentkit-cleanweb`**](https://www.npmjs.com/package/agentkit-cleanweb) | **Coinbase AgentKit Action Provider** (Base Mainnet EIP-712 & x402 Vaults) | `npm install agentkit-cleanweb @coinbase/agentkit` |
22
+
23
+ ---
24
+
25
+ ## โšก Key Capabilities
26
+ - ๐Ÿš€ **87% Token Compression**: Strips ads, navigation, scripts, and HTML boilerplateโ€”saving 85%+ in LLM input token costs on every web query.
27
+ - โ˜€๏ธ **Solana & Multi-Chain x402 Micropayments**: Instant `$0.001 USDC` settlement on Solana (`0.4s` finality), Base, Polygon, and Arbitrum.
28
+ - ๐Ÿ›ก๏ธ **Zero-Injection Cleansing (Security Gate)**: Neutralizes hidden CSS, Unicode steganography, and indirect prompt injection before LLM ingestion.
29
+ - ๐Ÿง  **ElizaOS Brain Causality & Priority 0 Dispatch**: Evaluates signal actionability (`Brier Score < 0.038`), predicts 0.5โ€“4h market lead times, and dispatches Priority 0 alerts to A.GRID HQ.
30
+ - ๐Ÿ” **Double Cryptographic Seal**: Every extracted payload is verifiable via Keccak-256 Merkle Root + EIP-712 Oracle Signature.
31
+
32
+ ---
33
+
34
+ ## ๐Ÿ“ฆ Installation
35
+
36
+ ```bash
37
+ # 1. Install the ElizaOS v2 Plugin (TypeScript / Node.js)
38
+ npm install cleanweb-eliza-plugin
39
+
40
+ # 2. (Recommended) Install the Companion Python Core & MCP Server
41
+ pip install x402-cleanweb-agent
42
+ ```
43
+
44
+ ---
45
+
46
+ ## ๐Ÿ’ป Quick Start (ElizaOS Character Configuration)
47
+
48
+ ```typescript
49
+ import { cleanWebPlugin } from "cleanweb-eliza-plugin";
50
+
51
+ export default {
52
+ name: "AutonomousAlphaAgent",
53
+ plugins: [cleanWebPlugin],
54
+ settings: {
55
+ secrets: {
56
+ CLEANWEB_VAULT_KEY: process.env.CLEANWEB_VAULT_KEY,
57
+ },
58
+ },
59
+ };
60
+ ```
61
+
62
+ ---
63
+
64
+ ## ๐Ÿ–ฅ๏ธ Companion MCP Server Setup (Claude Desktop, Cursor, Windsurf)
65
+
66
+ Pair your ElizaOS agent with the Python MCP Server from [`x402-cleanweb-agent` (PyPI)](https://pypi.org/project/x402-cleanweb-agent/):
67
+
68
+ ```json
69
+ {
70
+ "mcpServers": {
71
+ "x402-cleanweb": {
72
+ "command": "uvx",
73
+ "args": ["x402-cleanweb-agent"]
74
+ }
75
+ }
76
+ }
77
+ ```
78
+
79
+ ---
80
+
81
+ ## ๐Ÿ“„ License
82
+
83
+ MIT ยฉ [CleanWeb & A.GRID Protocol](https://github.com/nohosa001-pixel/x402-cleanweb-agent)
package/package.json CHANGED
@@ -1,47 +1,47 @@
1
- {
2
- "name": "cleanweb-eliza-plugin",
3
- "version": "1.0.0",
4
- "description": "CleanWeb 87% token-compressed ad-free web intelligence, fresh ground truth discovery, and Solana x402 autonomous micropayments for ElizaOS",
5
- "main": "dist/index.js",
6
- "module": "dist/index.js",
7
- "types": "dist/index.d.ts",
8
- "type": "module",
9
- "repository": {
10
- "type": "git",
11
- "url": "git+https://github.com/nohosa001-pixel/x402-cleanweb-agent.git",
12
- "directory": "packages/plugin-cleanweb"
13
- },
14
- "publishConfig": {
15
- "access": "public"
16
- },
17
- "scripts": {
18
- "build": "tsc",
19
- "test": "node --test"
20
- },
21
- "keywords": [
22
- "elizaos",
23
- "eliza",
24
- "cleanweb",
25
- "solana",
26
- "x402",
27
- "web-scraping",
28
- "ground-truth",
29
- "token-reduction",
30
- "ai-agent"
31
- ],
32
- "author": "CleanWeb & A.GRID Team",
33
- "license": "MIT",
34
- "peerDependencies": {
35
- "@elizaos/core": ">=2.0.0-0"
36
- },
37
- "dependencies": {},
38
- "devDependencies": {
39
- "typescript": "^5.8.2",
40
- "@types/node": "^22.13.0"
41
- },
42
- "files": [
43
- "dist",
44
- "src",
45
- "README.md"
46
- ]
1
+ {
2
+ "name": "cleanweb-eliza-plugin",
3
+ "version": "1.0.1",
4
+ "description": "CleanWeb 87% token-compressed ad-free web intelligence, fresh ground truth discovery, and Solana x402 autonomous micropayments for ElizaOS",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "type": "module",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/nohosa001-pixel/x402-cleanweb-agent.git",
12
+ "directory": "packages/plugin-cleanweb"
13
+ },
14
+ "publishConfig": {
15
+ "access": "public"
16
+ },
17
+ "scripts": {
18
+ "build": "tsc",
19
+ "test": "node --test"
20
+ },
21
+ "keywords": [
22
+ "elizaos",
23
+ "eliza",
24
+ "cleanweb",
25
+ "solana",
26
+ "x402",
27
+ "web-scraping",
28
+ "ground-truth",
29
+ "token-reduction",
30
+ "ai-agent"
31
+ ],
32
+ "author": "CleanWeb & A.GRID Team",
33
+ "license": "MIT",
34
+ "peerDependencies": {
35
+ "@elizaos/core": ">=2.0.0-0"
36
+ },
37
+ "dependencies": {},
38
+ "devDependencies": {
39
+ "typescript": "^5.8.2",
40
+ "@types/node": "^22.13.0"
41
+ },
42
+ "files": [
43
+ "dist",
44
+ "src",
45
+ "README.md"
46
+ ]
47
47
  }
@@ -1,52 +1,52 @@
1
- export const scrapeWebAction = {
2
- name: "CLEANWEB_SCRAPE",
3
- similes: ["FETCH_CLEAN_URL", "BROWSE_PAGE_NOISE_FREE", "READ_ARTICLE_CLEAN"],
4
- description: "Scrapes any webpage URL and returns pure, LLM-optimized Markdown with 87% token reduction and zero HTML boilerplate.",
5
- validate: async (runtime: any, message: any) => {
6
- const text = message.content?.text || "";
7
- return /https?:\/\/[^\s]+/i.test(text);
8
- },
9
- handler: async (runtime: any, message: any, state: any, options: any, callback: any) => {
10
- const text = message.content?.text || "";
11
- const urlMatch = text.match(/https?:\/\/[^\s]+/i);
12
- if (!urlMatch) {
13
- if (callback) callback({ text: "URL์„ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค." });
14
- return false;
15
- }
16
- const targetUrl = urlMatch[0];
17
- const gateway = process.env.CLEANWEB_GATEWAY_URL || "https://x402-cleanweb-agent-212942243360.asia-northeast3.run.app";
18
- const endpoint = `${gateway}/r/${encodeURIComponent(targetUrl)}`;
19
-
20
- try {
21
- const resp = await fetch(endpoint, {
22
- headers: {
23
- "User-Agent": "ElizaOS-CleanWebPlugin/1.0",
24
- "X-Agent-Nonce": runtime.character?.name || "eliza_agent",
25
- "Accept": "text/markdown, application/json"
26
- }
27
- });
28
-
29
- if (resp.status === 402) {
30
- const solanaNotice = "โšก HTTP 402 Payment Required: Solana Agent Payment Vault (7oZ16Ya...) or 0.001 USDC required.";
31
- if (callback) callback({ text: solanaNotice });
32
- return true;
33
- }
34
-
35
- const cleanText = await resp.text();
36
- const compression = resp.headers.get("x-token-compression") || "87%";
37
- const resultMsg = `[CleanWeb Studio | ${compression} Token Compression]\n\n${cleanText.slice(0, 3000)}`;
38
-
39
- if (callback) callback({ text: resultMsg });
40
- return true;
41
- } catch (err: any) {
42
- if (callback) callback({ text: `CleanWeb fetch failed: ${err.message}` });
43
- return false;
44
- }
45
- },
46
- examples: [
47
- [
48
- { user: "{{user1}}", content: { text: "์ด ๋‰ด์Šค ๊ธฐ์‚ฌ ๋‚ด์šฉ ์ •๋ฆฌํ•ด์ค˜ https://example.com/news" } },
49
- { user: "{{agentName}}", content: { text: "CleanWeb์œผ๋กœ 87% ์••์ถ•๋œ ๊ณ ์ˆœ๋„ ๋งˆํฌ๋‹ค์šด์„ ๋ถ„์„ํ•ฉ๋‹ˆ๋‹ค...", action: "CLEANWEB_SCRAPE" } }
50
- ]
51
- ]
52
- };
1
+ export const scrapeWebAction = {
2
+ name: "CLEANWEB_SCRAPE",
3
+ similes: ["FETCH_CLEAN_URL", "BROWSE_PAGE_NOISE_FREE", "READ_ARTICLE_CLEAN"],
4
+ description: "Scrapes any webpage URL and returns pure, LLM-optimized Markdown with 87% token reduction and zero HTML boilerplate.",
5
+ validate: async (runtime: any, message: any) => {
6
+ const text = message.content?.text || "";
7
+ return /https?:\/\/[^\s]+/i.test(text);
8
+ },
9
+ handler: async (runtime: any, message: any, state: any, options: any, callback: any) => {
10
+ const text = message.content?.text || "";
11
+ const urlMatch = text.match(/https?:\/\/[^\s]+/i);
12
+ if (!urlMatch) {
13
+ if (callback) callback({ text: "URL์„ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค." });
14
+ return false;
15
+ }
16
+ const targetUrl = urlMatch[0];
17
+ const gateway = process.env.CLEANWEB_GATEWAY_URL || "https://x402-cleanweb-agent-212942243360.asia-northeast3.run.app";
18
+ const endpoint = `${gateway}/r/${encodeURIComponent(targetUrl)}`;
19
+
20
+ try {
21
+ const resp = await fetch(endpoint, {
22
+ headers: {
23
+ "User-Agent": "ElizaOS-CleanWebPlugin/1.0",
24
+ "X-Agent-Nonce": runtime.character?.name || "eliza_agent",
25
+ "Accept": "text/markdown, application/json"
26
+ }
27
+ });
28
+
29
+ if (resp.status === 402) {
30
+ const solanaNotice = "โšก HTTP 402 Payment Required: Solana Agent Payment Vault (7oZ16Ya...) or 0.001 USDC required.";
31
+ if (callback) callback({ text: solanaNotice });
32
+ return true;
33
+ }
34
+
35
+ const cleanText = await resp.text();
36
+ const compression = resp.headers.get("x-token-compression") || "87%";
37
+ const resultMsg = `[CleanWeb Studio | ${compression} Token Compression]\n\n${cleanText.slice(0, 3000)}`;
38
+
39
+ if (callback) callback({ text: resultMsg });
40
+ return true;
41
+ } catch (err: any) {
42
+ if (callback) callback({ text: `CleanWeb fetch failed: ${err.message}` });
43
+ return false;
44
+ }
45
+ },
46
+ examples: [
47
+ [
48
+ { user: "{{user1}}", content: { text: "์ด ๋‰ด์Šค ๊ธฐ์‚ฌ ๋‚ด์šฉ ์ •๋ฆฌํ•ด์ค˜ https://example.com/news" } },
49
+ { user: "{{agentName}}", content: { text: "CleanWeb์œผ๋กœ 87% ์••์ถ•๋œ ๊ณ ์ˆœ๋„ ๋งˆํฌ๋‹ค์šด์„ ๋ถ„์„ํ•ฉ๋‹ˆ๋‹ค...", action: "CLEANWEB_SCRAPE" } }
50
+ ]
51
+ ]
52
+ };
@@ -1,17 +1,17 @@
1
- export const groundTruthSignalEvaluator = {
2
- name: "GROUND_TRUTH_EVALUATOR",
3
- similes: ["EVALUATE_WORLD_SIGNAL", "ASSESS_CAUSALITY_IMPACT"],
4
- description: "Evaluates incoming conversations and intelligence streams for critical policy shifts, trade disruptions, and economic invariants.",
5
- validate: async (runtime: any, message: any) => {
6
- const text = (message.content?.text || "").toLowerCase();
7
- return ["eudr", "mineral", "deforestation", "port congestion", "export ban", "strike", "power grid"].some(k => text.includes(k));
8
- },
9
- handler: async (runtime: any, message: any) => {
10
- return {
11
- evaluated: true,
12
- priority: "HIGH_GROUND_TRUTH",
13
- syncToAGrid: true,
14
- timestamp: new Date().toISOString()
15
- };
16
- }
17
- };
1
+ export const groundTruthSignalEvaluator = {
2
+ name: "GROUND_TRUTH_EVALUATOR",
3
+ similes: ["EVALUATE_WORLD_SIGNAL", "ASSESS_CAUSALITY_IMPACT"],
4
+ description: "Evaluates incoming conversations and intelligence streams for critical policy shifts, trade disruptions, and economic invariants.",
5
+ validate: async (runtime: any, message: any) => {
6
+ const text = (message.content?.text || "").toLowerCase();
7
+ return ["eudr", "mineral", "deforestation", "port congestion", "export ban", "strike", "power grid"].some(k => text.includes(k));
8
+ },
9
+ handler: async (runtime: any, message: any) => {
10
+ return {
11
+ evaluated: true,
12
+ priority: "HIGH_GROUND_TRUTH",
13
+ syncToAGrid: true,
14
+ timestamp: new Date().toISOString()
15
+ };
16
+ }
17
+ };
package/src/index.ts CHANGED
@@ -1,17 +1,17 @@
1
- import { scrapeWebAction } from "./actions/scrape.js";
2
- import { cleanWebIntelligenceProvider } from "./providers/intelligence.js";
3
- import { groundTruthSignalEvaluator } from "./evaluators/signal.js";
4
-
5
- export const cleanWebPlugin = {
6
- name: "cleanweb",
7
- description: "CleanWeb Studio 87% Token Reduction, Fresh Ground Truth Discovery, and Solana x402 Autonomous Micropayment Rail for ElizaOS",
8
- actions: [scrapeWebAction],
9
- providers: [cleanWebIntelligenceProvider],
10
- evaluators: [groundTruthSignalEvaluator],
11
- services: []
12
- };
13
-
14
- export default cleanWebPlugin;
15
- export * from "./actions/scrape.js";
16
- export * from "./providers/intelligence.js";
17
- export * from "./evaluators/signal.js";
1
+ import { scrapeWebAction } from "./actions/scrape.js";
2
+ import { cleanWebIntelligenceProvider } from "./providers/intelligence.js";
3
+ import { groundTruthSignalEvaluator } from "./evaluators/signal.js";
4
+
5
+ export const cleanWebPlugin = {
6
+ name: "cleanweb",
7
+ description: "CleanWeb Studio 87% Token Reduction, Fresh Ground Truth Discovery, and Solana x402 Autonomous Micropayment Rail for ElizaOS",
8
+ actions: [scrapeWebAction],
9
+ providers: [cleanWebIntelligenceProvider],
10
+ evaluators: [groundTruthSignalEvaluator],
11
+ services: []
12
+ };
13
+
14
+ export default cleanWebPlugin;
15
+ export * from "./actions/scrape.js";
16
+ export * from "./providers/intelligence.js";
17
+ export * from "./evaluators/signal.js";
@@ -1,17 +1,17 @@
1
- export const cleanWebIntelligenceProvider = {
2
- get: async (runtime: any, message: any, state: any) => {
3
- const gateway = process.env.CLEANWEB_GATEWAY_URL || "https://x402-cleanweb-agent-212942243360.asia-northeast3.run.app";
4
- return {
5
- provider: "CleanWeb & A.GRID Global Intelligence",
6
- capabilities: [
7
- "87% Token Reduced Web Scraping",
8
- "EUDR & Critical Mineral Ground-Truth Invariants",
9
- "Solana Mainnet 0.4s x402 Micropayments",
10
- "Merkle Proof Cryptographic Verification"
11
- ],
12
- gatewayUrl: gateway,
13
- treasuryRecipient: "411ksMz9RHYVtVMe6RUUErzZYtrU9zzvkgzswKbqx9qp",
14
- tokenMint: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
15
- };
16
- }
17
- };
1
+ export const cleanWebIntelligenceProvider = {
2
+ get: async (runtime: any, message: any, state: any) => {
3
+ const gateway = process.env.CLEANWEB_GATEWAY_URL || "https://x402-cleanweb-agent-212942243360.asia-northeast3.run.app";
4
+ return {
5
+ provider: "CleanWeb & A.GRID Global Intelligence",
6
+ capabilities: [
7
+ "87% Token Reduced Web Scraping",
8
+ "EUDR & Critical Mineral Ground-Truth Invariants",
9
+ "Solana Mainnet 0.4s x402 Micropayments",
10
+ "Merkle Proof Cryptographic Verification"
11
+ ],
12
+ gatewayUrl: gateway,
13
+ treasuryRecipient: "411ksMz9RHYVtVMe6RUUErzZYtrU9zzvkgzswKbqx9qp",
14
+ tokenMint: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
15
+ };
16
+ }
17
+ };