@elizaos/plugin-farcaster 2.0.0-alpha.8 → 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.
Files changed (74) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +108 -0
  3. package/auto-enable.ts +21 -0
  4. package/dist/actions/index.d.ts +2 -0
  5. package/dist/actions/index.d.ts.map +1 -0
  6. package/dist/auto-enable.d.ts +4 -0
  7. package/dist/auto-enable.d.ts.map +1 -0
  8. package/dist/browser/index.d.ts +2 -2
  9. package/dist/cjs/index.d.ts +2 -2
  10. package/dist/cjs/index.node.cjs +870 -719
  11. package/dist/cjs/index.node.js.map +23 -26
  12. package/dist/client/FarcasterClient.d.ts +41 -0
  13. package/dist/client/FarcasterClient.d.ts.map +1 -0
  14. package/dist/client/index.d.ts +2 -0
  15. package/dist/client/index.d.ts.map +1 -0
  16. package/dist/connector-account-provider.d.ts +16 -0
  17. package/dist/connector-account-provider.d.ts.map +1 -0
  18. package/dist/generated/specs/spec-helpers.d.ts +36 -0
  19. package/dist/generated/specs/spec-helpers.d.ts.map +1 -0
  20. package/dist/generated/specs/specs.d.ts +48 -0
  21. package/dist/generated/specs/specs.d.ts.map +1 -0
  22. package/dist/index.browser.d.ts +11 -0
  23. package/dist/index.browser.d.ts.map +1 -0
  24. package/dist/index.d.ts +10 -2
  25. package/dist/index.d.ts.map +1 -0
  26. package/dist/index.node.d.ts +3 -0
  27. package/dist/index.node.d.ts.map +1 -0
  28. package/dist/managers/AgentManager.d.ts +20 -0
  29. package/dist/managers/AgentManager.d.ts.map +1 -0
  30. package/dist/managers/CastManager.d.ts +25 -0
  31. package/dist/managers/CastManager.d.ts.map +1 -0
  32. package/dist/managers/EmbedManager.d.ts +40 -0
  33. package/dist/managers/EmbedManager.d.ts.map +1 -0
  34. package/dist/managers/InteractionManager.d.ts +32 -0
  35. package/dist/managers/InteractionManager.d.ts.map +1 -0
  36. package/dist/managers/InteractionProcessor.d.ts +10 -0
  37. package/dist/managers/InteractionProcessor.d.ts.map +1 -0
  38. package/dist/managers/InteractionSource.d.ts +38 -0
  39. package/dist/managers/InteractionSource.d.ts.map +1 -0
  40. package/dist/managers/index.d.ts +7 -0
  41. package/dist/managers/index.d.ts.map +1 -0
  42. package/dist/node/index.d.ts +2 -2
  43. package/dist/node/index.node.d.ts +2 -0
  44. package/dist/node/index.node.js +830 -704
  45. package/dist/node/index.node.js.map +23 -26
  46. package/dist/providers/index.d.ts +4 -0
  47. package/dist/providers/index.d.ts.map +1 -0
  48. package/dist/providers/profileProvider.d.ts +3 -0
  49. package/dist/providers/profileProvider.d.ts.map +1 -0
  50. package/dist/routes/webhook.d.ts +3 -0
  51. package/dist/routes/webhook.d.ts.map +1 -0
  52. package/dist/services/CastService.d.ts +133 -0
  53. package/dist/services/CastService.d.ts.map +1 -0
  54. package/dist/services/FarcasterService.d.ts +32 -0
  55. package/dist/services/FarcasterService.d.ts.map +1 -0
  56. package/dist/services/MessageService.d.ts +54 -0
  57. package/dist/services/MessageService.d.ts.map +1 -0
  58. package/dist/services/index.d.ts +4 -0
  59. package/dist/services/index.d.ts.map +1 -0
  60. package/dist/types/index.d.ts +119 -0
  61. package/dist/types/index.d.ts.map +1 -0
  62. package/dist/utils/asyncqueue.d.ts +13 -0
  63. package/dist/utils/asyncqueue.d.ts.map +1 -0
  64. package/dist/utils/callbacks.d.ts +14 -0
  65. package/dist/utils/callbacks.d.ts.map +1 -0
  66. package/dist/utils/config.d.ts +14 -0
  67. package/dist/utils/config.d.ts.map +1 -0
  68. package/dist/utils/index.d.ts +25 -0
  69. package/dist/utils/index.d.ts.map +1 -0
  70. package/dist/utils/prompts.d.ts +5 -0
  71. package/dist/utils/prompts.d.ts.map +1 -0
  72. package/dist/workflow-credential-provider.d.ts +21 -0
  73. package/dist/workflow-credential-provider.d.ts.map +1 -0
  74. 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,2 @@
1
+ export declare const farcasterActions: any[];
2
+ //# sourceMappingURL=index.d.ts.map
@@ -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"}
@@ -1,2 +1,2 @@
1
- export * from "./index.browser";
2
- export { default } from "./index.browser";
1
+ export * from "../index.browser";
2
+ export { default } from "../index.browser";
@@ -1,2 +1,2 @@
1
- export * from "./index.node";
2
- export { default } from "./index.node";
1
+ export * from "../index.node";
2
+ export { default } from "../index.node";