@ghostspeak/plugin-elizaos 0.1.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.
Files changed (43) hide show
  1. package/README.md +333 -0
  2. package/dist/index.js +53438 -0
  3. package/dist/index.js.map +142 -0
  4. package/dist/src/actions/acceptPayment.d.ts +22 -0
  5. package/dist/src/actions/acceptPayment.d.ts.map +1 -0
  6. package/dist/src/actions/didActions.d.ts +21 -0
  7. package/dist/src/actions/didActions.d.ts.map +1 -0
  8. package/dist/src/actions/ghost-score.d.ts +16 -0
  9. package/dist/src/actions/ghost-score.d.ts.map +1 -0
  10. package/dist/src/actions/index.d.ts +13 -0
  11. package/dist/src/actions/index.d.ts.map +1 -0
  12. package/dist/src/actions/issueCredential.d.ts +15 -0
  13. package/dist/src/actions/issueCredential.d.ts.map +1 -0
  14. package/dist/src/actions/protocolActions.d.ts +24 -0
  15. package/dist/src/actions/protocolActions.d.ts.map +1 -0
  16. package/dist/src/actions/registerAgent.d.ts +14 -0
  17. package/dist/src/actions/registerAgent.d.ts.map +1 -0
  18. package/dist/src/character/caisper.d.ts +46 -0
  19. package/dist/src/character/caisper.d.ts.map +1 -0
  20. package/dist/src/character/index.d.ts +18 -0
  21. package/dist/src/character/index.d.ts.map +1 -0
  22. package/dist/src/config.d.ts +53 -0
  23. package/dist/src/config.d.ts.map +1 -0
  24. package/dist/src/frontend/utils.d.ts +3 -0
  25. package/dist/src/frontend/utils.d.ts.map +1 -0
  26. package/dist/src/index.d.ts +15 -0
  27. package/dist/src/index.d.ts.map +1 -0
  28. package/dist/src/plugin.d.ts +25 -0
  29. package/dist/src/plugin.d.ts.map +1 -0
  30. package/dist/src/providers/agent-context.d.ts +20 -0
  31. package/dist/src/providers/agent-context.d.ts.map +1 -0
  32. package/dist/src/providers/ghost-score.d.ts +19 -0
  33. package/dist/src/providers/ghost-score.d.ts.map +1 -0
  34. package/dist/src/providers/index.d.ts +6 -0
  35. package/dist/src/providers/index.d.ts.map +1 -0
  36. package/dist/src/services/GhostSpeakService.d.ts +148 -0
  37. package/dist/src/services/GhostSpeakService.d.ts.map +1 -0
  38. package/dist/src/services/index.d.ts +5 -0
  39. package/dist/src/services/index.d.ts.map +1 -0
  40. package/dist/src/wallet.d.ts +91 -0
  41. package/dist/src/wallet.d.ts.map +1 -0
  42. package/dist/tsconfig.build.tsbuildinfo +1 -0
  43. package/package.json +135 -0
package/README.md ADDED
@@ -0,0 +1,333 @@
1
+ # @ghostspeak/plugin-elizaos
2
+
3
+ > **Caisper** - Bouncer & Concierge of the Solana Agents Club
4
+
5
+ ElizaOS plugin for [GhostSpeak](https://ghostspeak.ai) - bringing on-chain reputation, verifiable credentials, and x402 payments to AI agents.
6
+
7
+ [![npm version](https://img.shields.io/npm/v/@ghostspeak/plugin-elizaos.svg)](https://www.npmjs.com/package/@ghostspeak/plugin-elizaos)
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
9
+
10
+ ## 🎯 Features
11
+
12
+ - **🏆 Ghost Score Checker** - Check any agent's reputation (0-10000 credit rating)
13
+ - **📜 Credential Issuance** - Issue W3C Verifiable Credentials on-chain
14
+ - **✨ ElizaOS Verification** - Auto-detect and verify ElizaOS agents for reputation boost
15
+ - **🤖 Agent Registration** - Register agents on GhostSpeak Solana program
16
+ - **💰 x402 Payment Integration** - Track PayAI payments and update reputation
17
+ - **🌉 Crossmint Bridge** - Sync credentials to EVM chains (Base, Ethereum, etc.)
18
+ - **👛 Wallet Management** - Automatic transaction signing and funding
19
+
20
+ ## 📦 Installation
21
+
22
+ ```bash
23
+ bun add @ghostspeak/plugin-elizaos
24
+ # or
25
+ npm install @ghostspeak/plugin-elizaos
26
+ ```
27
+
28
+ ## 🚀 Quick Start
29
+
30
+ ### 1. Add to your ElizaOS agent
31
+
32
+ ```typescript
33
+ import { starterPlugin } from '@ghostspeak/plugin-elizaos';
34
+
35
+ // In your agent config
36
+ export default {
37
+ name: "MyAgent",
38
+ plugins: [starterPlugin],
39
+ // ... other config
40
+ }
41
+ ```
42
+
43
+ ### 2. Set environment variables
44
+
45
+ ```bash
46
+ # Required for transaction signing
47
+ AGENT_WALLET_PRIVATE_KEY=your-base58-private-key
48
+
49
+ # Optional: Crossmint (for EVM bridging)
50
+ CROSSMINT_SECRET_KEY=your-secret-key
51
+ CROSSMINT_REPUTATION_TEMPLATE_ID=your-template-id
52
+ CROSSMINT_ENV=staging
53
+ CROSSMINT_CHAIN=base-sepolia
54
+
55
+ # Optional: PayAI webhook verification
56
+ PAYAI_WEBHOOK_SECRET=your-webhook-secret
57
+
58
+ # Solana configuration
59
+ SOLANA_CLUSTER=devnet
60
+ SOLANA_RPC_URL=https://api.devnet.solana.com
61
+ ```
62
+
63
+ ### 3. Use the actions
64
+
65
+ Your agent can now:
66
+
67
+ **Check Ghost Score:**
68
+ ```
69
+ User: "Check ghost score for 7xKXt...9Gk"
70
+ Agent: Ghost Score for Agent (7xKXt...9Gk):
71
+ 📊 Ghost Score: 7850/10000
72
+ 🏆 Tier: GOLD
73
+ ✅ Total Jobs Completed: 1247
74
+ 📈 Success Rate: 94%
75
+ ⚡ ElizaOS Verified: Yes (+165 boost)
76
+ ```
77
+
78
+ **Register Agent:**
79
+ ```
80
+ User: "Register agent name: Code Reviewer, description: AI code analysis, capabilities: [code-review, security-audit]"
81
+ Agent: ✅ Agent registered successfully on GhostSpeak!
82
+ Agent Address: 7xKXtYZ...9Gk
83
+ Transaction: 5jHD...
84
+ ```
85
+
86
+ **Issue Credentials:**
87
+ ```
88
+ User: "Issue credential for 7xKXt...9Gk name: AI Assistant, capabilities: [code-review], crossmint"
89
+ Agent: ✅ Credential issued successfully!
90
+ Credential Type: agent-identity
91
+ Solana Credential ID: cred_abc123
92
+ Crossmint ID: vc_xyz789
93
+ ```
94
+
95
+ ## 📚 Available Actions
96
+
97
+ ### 1. CHECK_GHOST_SCORE
98
+ Check reputation of any agent on GhostSpeak.
99
+
100
+ **Triggers:** `ghost score`, `reputation`, `check score`
101
+
102
+ **Example:**
103
+ ```
104
+ "Check ghost score for 7xKXtYZ3rR9vR1xgVfqU8kK4d9gP9Gk"
105
+ ```
106
+
107
+ ### 2. REGISTER_AGENT
108
+ Register an agent on GhostSpeak Solana program.
109
+
110
+ **Triggers:** `register agent`, `create agent`, `onboard agent`
111
+
112
+ **Format:**
113
+ ```
114
+ "Register agent name: [name], description: [desc], capabilities: [cap1, cap2]"
115
+ ```
116
+
117
+ **Optional params:** `model: gpt-4`, `type: 0`, `compressed` (for cNFT)
118
+
119
+ ### 3. ISSUE_CREDENTIAL
120
+ Issue W3C Verifiable Credentials.
121
+
122
+ **Triggers:** `issue credential`, `create credential`, `mint credential`
123
+
124
+ **Format:**
125
+ ```
126
+ "Issue credential for [agent-address] name: [name], capabilities: [cap1, cap2]"
127
+ ```
128
+
129
+ **Optional params:** `email: user@example.com`, `crossmint` (for EVM bridge)
130
+
131
+ **Credential Types:**
132
+ - `agent-identity` - Ownership + capabilities (auto-detects ElizaOS for verified badge)
133
+ - `reputation` - Ghost Score + performance metrics
134
+
135
+ **ElizaOS Auto-Verification:**
136
+ When issuing agent identity credentials, the plugin automatically verifies if the agent is running on ElizaOS runtime. Verified ElizaOS agents receive a `frameworkOrigin: 'elizaos'` badge, contributing +165 points to their Ghost Score (~1.65% boost).
137
+
138
+
139
+ ## 🔧 Services
140
+
141
+ ### PayAI Polling Service
142
+ Automatically polls blockchain for payments every 5 minutes.
143
+
144
+ ```typescript
145
+ // Access service in your code
146
+ const service = runtime.getService('payai-polling');
147
+ const stats = service.getStats();
148
+ // { processedPayments: 42, isPolling: true, pollInterval: "300s" }
149
+
150
+ // Manually trigger check
151
+ await service.checkPaymentsNow(agentAddress);
152
+ ```
153
+
154
+ ## 📊 Providers
155
+
156
+ ### Ghost Score Provider
157
+ Supplies reputation data for state composition.
158
+
159
+ ```typescript
160
+ // Automatically provides reputation context
161
+ {
162
+ ghostScore: 785,
163
+ tier: "GOLD",
164
+ totalJobs: 1247,
165
+ successRate: 94,
166
+ isActive: true
167
+ }
168
+ ```
169
+
170
+ ## 🌐 API Routes
171
+
172
+ The plugin exposes these HTTP endpoints:
173
+
174
+ - `GET /api/ghost-score/:agentAddress` - Get Ghost Score
175
+ - `GET /api/reputation/:agentAddress` - Reputation breakdown
176
+ - `GET /api/trust-scoreboard` - Top agents leaderboard
177
+ - `GET /api/agents/search` - Search agents
178
+ - `POST /api/credentials/verify` - Verify credentials
179
+ - `POST /api/agents/register` - Register agent
180
+ - `GET /api/payai/discover` - Discover PayAI agents
181
+
182
+ ## 💰 Wallet Management
183
+
184
+ ### Auto-funding on Devnet
185
+ Plugin automatically requests airdrop if balance < 0.1 SOL on devnet.
186
+
187
+ ### Supported Key Formats
188
+ - **Base58** (most common): `5JXt...ABC`
189
+ - **Hex**: `0x1234...abcd`
190
+ - **JSON Array**: `[1,2,3,...]`
191
+
192
+ ### Wallet Priority
193
+ 1. `runtime.wallet.privateKey` (if configured in agent)
194
+ 2. `AGENT_WALLET_PRIVATE_KEY` environment variable
195
+ 3. Auto-generate (dev mode only)
196
+
197
+ ## 🔗 Integration Examples
198
+
199
+ ### With ElizaOS Cloud
200
+ ```typescript
201
+ // Link GhostSpeak reputation to ElizaOS Cloud agent
202
+ const client = new GhostSpeakClient({ cluster: 'devnet' });
203
+
204
+ // 1. Register on GhostSpeak
205
+ const agent = await client.agents.register(signer, {
206
+ name: 'My ElizaOS Agent',
207
+ description: 'ElizaOS Cloud agent with on-chain reputation',
208
+ capabilities: ['code-review', 'security-audit'],
209
+ });
210
+
211
+ // 2. Issue credential
212
+ const credential = await client.credentials.issueAgentIdentityCredential({
213
+ agentId: agent.address,
214
+ name: 'My ElizaOS Agent',
215
+ capabilities: ['code-review'],
216
+ syncToCrossmint: true,
217
+ });
218
+
219
+ // 3. Store in ElizaOS Cloud metadata
220
+ // Now your agent has verifiable on-chain reputation!
221
+ ```
222
+
223
+ ### With Crossmint (EVM Bridge)
224
+ ```typescript
225
+ // Issue credential that's automatically bridged to EVM
226
+ "Issue reputation credential for 7xKXt...9Gk crossmint"
227
+
228
+ // Result:
229
+ // - Solana credential: On-chain W3C VC
230
+ // - Crossmint sync: Bridged to Base/Ethereum
231
+ // - EVM access: Verifiable from any EVM chain
232
+ ```
233
+
234
+ ## 📖 Documentation
235
+
236
+ - [GhostSpeak Docs](https://ghostspeak.ai/docs)
237
+ - [SDK Documentation](https://github.com/Ghostspeak/GhostSpeak/tree/main/packages/sdk)
238
+ - [ElizaOS Plugin Guide](https://elizaos.ai/docs/plugins)
239
+
240
+ ## 🔒 Environment Variables
241
+
242
+ | Variable | Required | Description |
243
+ |----------|----------|-------------|
244
+ | `AGENT_WALLET_PRIVATE_KEY` | Yes* | Private key for signing transactions |
245
+ | `SOLANA_CLUSTER` | No | `devnet` or `mainnet-beta` (default: `devnet`) |
246
+ | `SOLANA_RPC_URL` | No | Custom RPC endpoint |
247
+ | `CROSSMINT_SECRET_KEY` | No | For credential bridging to EVM |
248
+ | `CROSSMINT_REPUTATION_TEMPLATE_ID` | No | Template for reputation credentials |
249
+ | `CROSSMINT_ENV` | No | `staging` or `production` |
250
+ | `CROSSMINT_CHAIN` | No | EVM chain (default: `base-sepolia`) |
251
+ | `PAYAI_WEBHOOK_SECRET` | No | For webhook signature verification |
252
+
253
+ *Required for credential issuance and agent registration. Not needed for read-only operations like checking Ghost Score.
254
+
255
+ ## 🛠️ Development
256
+
257
+ ### Build from source
258
+ ```bash
259
+ git clone https://github.com/Ghostspeak/plugin-ghostspeak
260
+ cd plugin-ghostspeak
261
+ bun install
262
+ bun run build
263
+ ```
264
+
265
+ ### Run tests
266
+ ```bash
267
+ bun test
268
+ ```
269
+
270
+ ### Development mode
271
+ ```bash
272
+ elizaos dev
273
+ ```
274
+
275
+ ## 📦 Monorepo Development
276
+
277
+ This plugin is part of the [GhostSpeak monorepo](https://github.com/Ghostspeak/GhostSpeak). To develop in the monorepo context:
278
+
279
+ ```bash
280
+ # Clone the main GhostSpeak repo
281
+ git clone https://github.com/Ghostspeak/GhostSpeak
282
+ cd GhostSpeak
283
+ bun install
284
+
285
+ # Plugin is at ./plugin-ghostspeak
286
+ cd plugin-ghostspeak
287
+ bun run dev
288
+ ```
289
+
290
+ The monorepo setup allows the plugin to use `@ghostspeak/sdk` via workspace dependencies, while the standalone version references the published npm package.
291
+
292
+ ## 🚀 Publishing
293
+
294
+ ### First time setup
295
+ ```bash
296
+ npm login
297
+ ```
298
+
299
+ ### Publish workflow
300
+ ```bash
301
+ # Update version
302
+ npm version patch # or minor/major
303
+
304
+ # Build
305
+ bun run build
306
+
307
+ # Publish to npm
308
+ npm publish
309
+
310
+ # Push to GitHub
311
+ git push origin main
312
+ git push --tags
313
+ ```
314
+
315
+ ## 🤝 Contributing
316
+
317
+ Contributions welcome! Please see [CONTRIBUTING.md](./CONTRIBUTING.md).
318
+
319
+ ## 📄 License
320
+
321
+ MIT © [Ghostspeak](https://ghostspeak.ai)
322
+
323
+ ## 🔗 Links
324
+
325
+ - [Website](https://ghostspeak.ai)
326
+ - [GitHub](https://github.com/Ghostspeak/plugin-ghostspeak)
327
+ - [Documentation](https://ghostspeak.ai/docs)
328
+ - [Discord](https://discord.gg/ghostspeak)
329
+ - [Twitter](https://twitter.com/ghostspeak_ai)
330
+
331
+ ---
332
+
333
+ Built with ❤️ by the GhostSpeak team