@elizaos/plugin-farcaster 2.0.0-alpha.7 → 2.0.0-beta.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/LICENSE +21 -0
- package/README.md +108 -0
- package/auto-enable.ts +21 -0
- package/dist/actions/index.d.ts +2 -0
- package/dist/actions/index.d.ts.map +1 -0
- package/dist/auto-enable.d.ts +4 -0
- package/dist/auto-enable.d.ts.map +1 -0
- package/dist/browser/index.d.ts +2 -2
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.node.cjs +870 -719
- package/dist/cjs/index.node.js.map +23 -26
- package/dist/client/FarcasterClient.d.ts +41 -0
- package/dist/client/FarcasterClient.d.ts.map +1 -0
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/connector-account-provider.d.ts +16 -0
- package/dist/connector-account-provider.d.ts.map +1 -0
- package/dist/generated/specs/spec-helpers.d.ts +36 -0
- package/dist/generated/specs/spec-helpers.d.ts.map +1 -0
- package/dist/generated/specs/specs.d.ts +48 -0
- package/dist/generated/specs/specs.d.ts.map +1 -0
- package/dist/index.browser.d.ts +11 -0
- package/dist/index.browser.d.ts.map +1 -0
- package/dist/index.d.ts +10 -2
- package/dist/index.d.ts.map +1 -0
- package/dist/index.node.d.ts +3 -0
- package/dist/index.node.d.ts.map +1 -0
- package/dist/managers/AgentManager.d.ts +20 -0
- package/dist/managers/AgentManager.d.ts.map +1 -0
- package/dist/managers/CastManager.d.ts +25 -0
- package/dist/managers/CastManager.d.ts.map +1 -0
- package/dist/managers/EmbedManager.d.ts +40 -0
- package/dist/managers/EmbedManager.d.ts.map +1 -0
- package/dist/managers/InteractionManager.d.ts +32 -0
- package/dist/managers/InteractionManager.d.ts.map +1 -0
- package/dist/managers/InteractionProcessor.d.ts +10 -0
- package/dist/managers/InteractionProcessor.d.ts.map +1 -0
- package/dist/managers/InteractionSource.d.ts +38 -0
- package/dist/managers/InteractionSource.d.ts.map +1 -0
- package/dist/managers/index.d.ts +7 -0
- package/dist/managers/index.d.ts.map +1 -0
- package/dist/node/index.d.ts +2 -2
- package/dist/node/index.node.d.ts +2 -0
- package/dist/node/index.node.js +830 -704
- package/dist/node/index.node.js.map +23 -26
- package/dist/providers/index.d.ts +4 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/profileProvider.d.ts +3 -0
- package/dist/providers/profileProvider.d.ts.map +1 -0
- package/dist/routes/webhook.d.ts +3 -0
- package/dist/routes/webhook.d.ts.map +1 -0
- package/dist/services/CastService.d.ts +133 -0
- package/dist/services/CastService.d.ts.map +1 -0
- package/dist/services/FarcasterService.d.ts +32 -0
- package/dist/services/FarcasterService.d.ts.map +1 -0
- package/dist/services/MessageService.d.ts +54 -0
- package/dist/services/MessageService.d.ts.map +1 -0
- package/dist/services/index.d.ts +4 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +119 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/utils/asyncqueue.d.ts +13 -0
- package/dist/utils/asyncqueue.d.ts.map +1 -0
- package/dist/utils/callbacks.d.ts +14 -0
- package/dist/utils/callbacks.d.ts.map +1 -0
- package/dist/utils/config.d.ts +14 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/index.d.ts +25 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/prompts.d.ts +5 -0
- package/dist/utils/prompts.d.ts.map +1 -0
- package/dist/workflow-credential-provider.d.ts +21 -0
- package/dist/workflow-credential-provider.d.ts.map +1 -0
- package/package.json +20 -9
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Shaw Walters and elizaOS Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# @elizaos/plugin-farcaster
|
|
2
|
+
|
|
3
|
+
A multi-language Farcaster plugin for elizaOS, providing full integration with the Farcaster decentralized social network via the Neynar API.
|
|
4
|
+
|
|
5
|
+
## Languages
|
|
6
|
+
|
|
7
|
+
This plugin is implemented in three languages with full feature parity:
|
|
8
|
+
|
|
9
|
+
- **TypeScript** - Primary implementation for Node.js and browser
|
|
10
|
+
- **Python** - Python implementation for ML/AI pipelines
|
|
11
|
+
- **Rust** - High-performance implementation with WASM support
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
- **Cast Management**: Send casts, reply to casts, and manage your timeline
|
|
16
|
+
- **Profile Management**: Fetch and cache user profiles
|
|
17
|
+
- **Mentions & Notifications**: Monitor and respond to mentions
|
|
18
|
+
- **Timeline Provider**: Access your Farcaster feed
|
|
19
|
+
- **Thread Support**: Navigate and respond within cast threads
|
|
20
|
+
- **Embed Processing**: Handle images, videos, and embedded casts
|
|
21
|
+
- **Webhook Support**: Real-time updates via webhooks
|
|
22
|
+
- **Polling Mode**: Periodic fetching for simple deployments
|
|
23
|
+
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
### TypeScript/Node.js
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install @elizaos/plugin-farcaster
|
|
30
|
+
# or
|
|
31
|
+
bun add @elizaos/plugin-farcaster
|
|
32
|
+
```
|
|
33
|
+
## Configuration
|
|
34
|
+
|
|
35
|
+
The plugin requires the following environment variables:
|
|
36
|
+
|
|
37
|
+
| Variable | Required | Description |
|
|
38
|
+
| -------------------------- | -------- | --------------------------------------------------------- |
|
|
39
|
+
| `FARCASTER_FID` | Yes | Your Farcaster ID (FID) |
|
|
40
|
+
| `FARCASTER_SIGNER_UUID` | Yes | Neynar signer UUID for signing casts |
|
|
41
|
+
| `FARCASTER_NEYNAR_API_KEY` | Yes | Neynar API key for API access |
|
|
42
|
+
| `FARCASTER_DRY_RUN` | No | Enable dry run mode (default: false) |
|
|
43
|
+
| `FARCASTER_MODE` | No | Operation mode: 'polling' or 'webhook' (default: polling) |
|
|
44
|
+
| `MAX_CAST_LENGTH` | No | Maximum cast length (default: 320) |
|
|
45
|
+
| `FARCASTER_POLL_INTERVAL` | No | Polling interval in seconds (default: 120) |
|
|
46
|
+
| `ENABLE_CAST` | No | Enable auto-casting (default: true) |
|
|
47
|
+
| `CAST_INTERVAL_MIN` | No | Min cast interval in minutes (default: 90) |
|
|
48
|
+
| `CAST_INTERVAL_MAX` | No | Max cast interval in minutes (default: 180) |
|
|
49
|
+
|
|
50
|
+
## Usage
|
|
51
|
+
|
|
52
|
+
### TypeScript
|
|
53
|
+
|
|
54
|
+
```typescript
|
|
55
|
+
import farcasterPlugin from "@elizaos/plugin-farcaster";
|
|
56
|
+
|
|
57
|
+
// Register with agent runtime
|
|
58
|
+
const agent = new AgentRuntime({
|
|
59
|
+
plugins: [farcasterPlugin],
|
|
60
|
+
// ... other config
|
|
61
|
+
});
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Actions
|
|
65
|
+
|
|
66
|
+
Farcaster public posts are exposed through the primary `POST` action:
|
|
67
|
+
|
|
68
|
+
- `POST operation=send` publishes a cast through the Farcaster PostConnector.
|
|
69
|
+
- `POST operation=read` reads recent casts through the Farcaster PostConnector.
|
|
70
|
+
|
|
71
|
+
Farcaster search is not advertised until the local Neynar client exposes a
|
|
72
|
+
search primitive.
|
|
73
|
+
|
|
74
|
+
## Providers
|
|
75
|
+
|
|
76
|
+
### farcaster_profile
|
|
77
|
+
|
|
78
|
+
Provides the agent's Farcaster profile information for context.
|
|
79
|
+
|
|
80
|
+
### farcaster_thread
|
|
81
|
+
|
|
82
|
+
Provides thread context for understanding conversation flow.
|
|
83
|
+
|
|
84
|
+
## Development
|
|
85
|
+
|
|
86
|
+
### Building
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
# TypeScript
|
|
90
|
+
bun run build
|
|
91
|
+
# All languages
|
|
92
|
+
bun run test
|
|
93
|
+
|
|
94
|
+
# TypeScript only
|
|
95
|
+
bun run test:ts
|
|
96
|
+
|
|
97
|
+
# Python only
|
|
98
|
+
bun run test:python
|
|
99
|
+
|
|
100
|
+
# Rust only
|
|
101
|
+
bun run test:rust
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Linting
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
# TypeScript
|
|
108
|
+
bun run lint
|
package/auto-enable.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Auto-enable check for @elizaos/plugin-farcaster.
|
|
2
|
+
//
|
|
3
|
+
// Plugin manifest entry-point — referenced by package.json's
|
|
4
|
+
// `elizaos.plugin.autoEnableModule`. Keep this module light: env reads only,
|
|
5
|
+
// no service init, no transitive imports of the full plugin runtime. The
|
|
6
|
+
// auto-enable engine loads dozens of these per boot.
|
|
7
|
+
import type { PluginAutoEnableContext } from "@elizaos/core";
|
|
8
|
+
|
|
9
|
+
/** Enable when a `farcaster` connector block is present and not explicitly disabled. */
|
|
10
|
+
export function shouldEnable(ctx: PluginAutoEnableContext): boolean {
|
|
11
|
+
const c = (ctx.config?.connectors as Record<string, unknown> | undefined)
|
|
12
|
+
?.farcaster;
|
|
13
|
+
if (!c || typeof c !== "object") return false;
|
|
14
|
+
const config = c as Record<string, unknown>;
|
|
15
|
+
if (config.enabled === false) return false;
|
|
16
|
+
// The full per-connector field check (Neynar API key / signer / FID) lives
|
|
17
|
+
// in the central engine's isConnectorConfigured. We delegate to a simple
|
|
18
|
+
// "block present + not explicitly disabled" check here; the central
|
|
19
|
+
// engine's stricter check remains as a fallback during migration.
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,OAAK,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { PluginAutoEnableContext } from "@elizaos/core";
|
|
2
|
+
/** Enable when a `farcaster` connector block is present and not explicitly disabled. */
|
|
3
|
+
export declare function shouldEnable(ctx: PluginAutoEnableContext): boolean;
|
|
4
|
+
//# sourceMappingURL=auto-enable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-enable.d.ts","sourceRoot":"","sources":["../auto-enable.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAE7D,wFAAwF;AACxF,wBAAgB,YAAY,CAAC,GAAG,EAAE,uBAAuB,GAAG,OAAO,CAWlE"}
|
package/dist/browser/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "
|
|
2
|
-
export { default } from "
|
|
1
|
+
export * from "../index.browser";
|
|
2
|
+
export { default } from "../index.browser";
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "
|
|
2
|
-
export { default } from "
|
|
1
|
+
export * from "../index.node";
|
|
2
|
+
export { default } from "../index.node";
|