@elizaos/plugin-farcaster 2.0.0-beta.1 → 2.0.11-beta.7

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 (75) hide show
  1. package/README.md +42 -75
  2. package/auto-enable.ts +1 -1
  3. package/package.json +12 -6
  4. package/dist/actions/index.d.ts +0 -2
  5. package/dist/actions/index.d.ts.map +0 -1
  6. package/dist/auto-enable.d.ts +0 -4
  7. package/dist/auto-enable.d.ts.map +0 -1
  8. package/dist/browser/index.browser.js +0 -16
  9. package/dist/browser/index.browser.js.map +0 -10
  10. package/dist/browser/index.d.ts +0 -2
  11. package/dist/cjs/index.d.ts +0 -2
  12. package/dist/cjs/index.node.cjs +0 -2555
  13. package/dist/cjs/index.node.js.map +0 -31
  14. package/dist/client/FarcasterClient.d.ts +0 -41
  15. package/dist/client/FarcasterClient.d.ts.map +0 -1
  16. package/dist/client/index.d.ts +0 -2
  17. package/dist/client/index.d.ts.map +0 -1
  18. package/dist/connector-account-provider.d.ts +0 -16
  19. package/dist/connector-account-provider.d.ts.map +0 -1
  20. package/dist/generated/specs/spec-helpers.d.ts +0 -36
  21. package/dist/generated/specs/spec-helpers.d.ts.map +0 -1
  22. package/dist/generated/specs/specs.d.ts +0 -48
  23. package/dist/generated/specs/specs.d.ts.map +0 -1
  24. package/dist/index.browser.d.ts +0 -11
  25. package/dist/index.browser.d.ts.map +0 -1
  26. package/dist/index.d.ts +0 -10
  27. package/dist/index.d.ts.map +0 -1
  28. package/dist/index.node.d.ts +0 -3
  29. package/dist/index.node.d.ts.map +0 -1
  30. package/dist/managers/AgentManager.d.ts +0 -20
  31. package/dist/managers/AgentManager.d.ts.map +0 -1
  32. package/dist/managers/CastManager.d.ts +0 -25
  33. package/dist/managers/CastManager.d.ts.map +0 -1
  34. package/dist/managers/EmbedManager.d.ts +0 -40
  35. package/dist/managers/EmbedManager.d.ts.map +0 -1
  36. package/dist/managers/InteractionManager.d.ts +0 -32
  37. package/dist/managers/InteractionManager.d.ts.map +0 -1
  38. package/dist/managers/InteractionProcessor.d.ts +0 -10
  39. package/dist/managers/InteractionProcessor.d.ts.map +0 -1
  40. package/dist/managers/InteractionSource.d.ts +0 -38
  41. package/dist/managers/InteractionSource.d.ts.map +0 -1
  42. package/dist/managers/index.d.ts +0 -7
  43. package/dist/managers/index.d.ts.map +0 -1
  44. package/dist/node/index.d.ts +0 -2
  45. package/dist/node/index.node.d.ts +0 -2
  46. package/dist/node/index.node.js +0 -2505
  47. package/dist/node/index.node.js.map +0 -31
  48. package/dist/providers/index.d.ts +0 -4
  49. package/dist/providers/index.d.ts.map +0 -1
  50. package/dist/providers/profileProvider.d.ts +0 -3
  51. package/dist/providers/profileProvider.d.ts.map +0 -1
  52. package/dist/routes/webhook.d.ts +0 -3
  53. package/dist/routes/webhook.d.ts.map +0 -1
  54. package/dist/services/CastService.d.ts +0 -133
  55. package/dist/services/CastService.d.ts.map +0 -1
  56. package/dist/services/FarcasterService.d.ts +0 -32
  57. package/dist/services/FarcasterService.d.ts.map +0 -1
  58. package/dist/services/MessageService.d.ts +0 -54
  59. package/dist/services/MessageService.d.ts.map +0 -1
  60. package/dist/services/index.d.ts +0 -4
  61. package/dist/services/index.d.ts.map +0 -1
  62. package/dist/types/index.d.ts +0 -119
  63. package/dist/types/index.d.ts.map +0 -1
  64. package/dist/utils/asyncqueue.d.ts +0 -13
  65. package/dist/utils/asyncqueue.d.ts.map +0 -1
  66. package/dist/utils/callbacks.d.ts +0 -14
  67. package/dist/utils/callbacks.d.ts.map +0 -1
  68. package/dist/utils/config.d.ts +0 -14
  69. package/dist/utils/config.d.ts.map +0 -1
  70. package/dist/utils/index.d.ts +0 -25
  71. package/dist/utils/index.d.ts.map +0 -1
  72. package/dist/utils/prompts.d.ts +0 -5
  73. package/dist/utils/prompts.d.ts.map +0 -1
  74. package/dist/workflow-credential-provider.d.ts +0 -21
  75. package/dist/workflow-credential-provider.d.ts.map +0 -1
package/README.md CHANGED
@@ -1,108 +1,75 @@
1
1
  # @elizaos/plugin-farcaster
2
2
 
3
- A multi-language Farcaster plugin for elizaOS, providing full integration with the Farcaster decentralized social network via the Neynar API.
3
+ Farcaster client plugin for [elizaOS](https://github.com/elizaOS/eliza). Gives an Eliza agent the ability to publish casts, reply to mentions, read its feed, and react to casts on the Farcaster decentralized social network via the [Neynar API](https://neynar.com).
4
4
 
5
- ## Languages
5
+ ## Capabilities
6
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
7
+ - **Cast publishing** send new casts and thread replies; auto-truncates to 320 characters using the agent's language model when needed.
8
+ - **Feed reading** — fetch and search the authenticated account's recent timeline.
9
+ - **Mentions & interactions** monitor mentions and respond in polling mode or via real-time webhook.
10
+ - **Reactions** like, unlike, recast, and remove recasts.
11
+ - **Thread traversal** walk a cast thread back to its root.
12
+ - **Profile provider** — injects the agent's Farcaster profile (FID, username, display name) as context for social-posting and messaging tasks.
13
+ - **Webhook handler** — `POST /webhook` route processes Neynar webhook events in real time.
14
+ - **Multi-account** — one agent can manage multiple Farcaster accounts via namespaced env vars.
23
15
 
24
16
  ## Installation
25
17
 
26
- ### TypeScript/Node.js
27
-
28
18
  ```bash
29
- npm install @elizaos/plugin-farcaster
30
- # or
31
19
  bun add @elizaos/plugin-farcaster
32
20
  ```
33
- ## Configuration
34
21
 
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
22
+ ## Configuration
51
23
 
52
- ### TypeScript
24
+ The plugin is auto-enabled when a `farcaster` connector block is present in the agent config. Register it manually if needed:
53
25
 
54
26
  ```typescript
55
27
  import farcasterPlugin from "@elizaos/plugin-farcaster";
56
28
 
57
- // Register with agent runtime
58
29
  const agent = new AgentRuntime({
59
30
  plugins: [farcasterPlugin],
60
- // ... other config
31
+ // ...
61
32
  });
62
33
  ```
63
34
 
64
- ## Actions
65
-
66
- Farcaster public posts are exposed through the primary `POST` action:
35
+ ### Environment variables
67
36
 
68
- - `POST operation=send` publishes a cast through the Farcaster PostConnector.
69
- - `POST operation=read` reads recent casts through the Farcaster PostConnector.
37
+ | Variable | Required | Default | Description |
38
+ |----------------------------|----------|--------------------|-------------|
39
+ | `FARCASTER_NEYNAR_API_KEY` | yes | — | Neynar API key |
40
+ | `FARCASTER_FID` | yes | — | Farcaster user ID (integer) |
41
+ | `FARCASTER_SIGNER_UUID` | yes | — | Neynar signer UUID |
42
+ | `FARCASTER_MODE` | no | `polling` | `polling` or `webhook` |
43
+ | `FARCASTER_HUB_URL` | no | `hub.pinata.cloud` | Farcaster hub base URL |
44
+ | `FARCASTER_POLL_INTERVAL` | no | `120` | Seconds between polling cycles |
45
+ | `FARCASTER_DRY_RUN` | no | `false` | Simulate without publishing |
46
+ | `MAX_CAST_LENGTH` | no | `320` | Max cast characters |
47
+ | `ENABLE_CAST` | no | `true` | Enable autonomous cast loop |
48
+ | `CAST_INTERVAL_MIN` | no | `90` | Min minutes between autonomous casts |
49
+ | `CAST_INTERVAL_MAX` | no | `180` | Max minutes between autonomous casts |
50
+ | `CAST_IMMEDIATELY` | no | `false` | Post first cast immediately on start |
51
+ | `ENABLE_ACTION_PROCESSING` | no | `false` | Process mentions automatically |
52
+ | `ACTION_INTERVAL` | no | `5` | Minutes between action-processing cycles |
53
+ | `MAX_ACTIONS_PROCESSING` | no | `1` | Max interactions processed per cycle |
70
54
 
71
- Farcaster search is not advertised until the local Neynar client exposes a
72
- search primitive.
55
+ For multi-account setups, prefix any variable with `FARCASTER_<ACCOUNT_ID>_` (e.g. `FARCASTER_MYACCT_FID`).
73
56
 
74
- ## Providers
57
+ ### Webhook mode
75
58
 
76
- ### farcaster_profile
59
+ Set `FARCASTER_MODE=webhook` and configure your Neynar app to send webhook events to `POST /webhook` on your agent's public URL. The handler validates the `NeynarWebhookData` payload shape before processing.
77
60
 
78
- Provides the agent's Farcaster profile information for context.
61
+ ## Providers
79
62
 
80
- ### farcaster_thread
63
+ ### `farcasterProfile`
81
64
 
82
- Provides thread context for understanding conversation flow.
65
+ Injects the agent's current Farcaster profile (FID, username, display name) into the context for turns in the `social_posting`, `messaging`, and `connectors` contexts.
83
66
 
84
67
  ## Development
85
68
 
86
- ### Building
87
-
88
69
  ```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
70
+ bun run --cwd plugins/plugin-farcaster build # build node + browser bundles
71
+ bun run --cwd plugins/plugin-farcaster dev # watch mode
72
+ bun run --cwd plugins/plugin-farcaster test # run all tests
73
+ bun run --cwd plugins/plugin-farcaster typecheck # type-check only
74
+ bun run --cwd plugins/plugin-farcaster lint # biome check + fix
102
75
  ```
103
-
104
- ### Linting
105
-
106
- ```bash
107
- # TypeScript
108
- bun run lint
package/auto-enable.ts CHANGED
@@ -8,7 +8,7 @@ import type { PluginAutoEnableContext } from "@elizaos/core";
8
8
 
9
9
  /** Enable when a `farcaster` connector block is present and not explicitly disabled. */
10
10
  export function shouldEnable(ctx: PluginAutoEnableContext): boolean {
11
- const c = (ctx.config?.connectors as Record<string, unknown> | undefined)
11
+ const c = (ctx.config.connectors as Record<string, unknown> | undefined)
12
12
  ?.farcaster;
13
13
  if (!c || typeof c !== "object") return false;
14
14
  const config = c as Record<string, unknown>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elizaos/plugin-farcaster",
3
- "version": "2.0.0-beta.1",
3
+ "version": "2.0.11-beta.7",
4
4
  "type": "module",
5
5
  "main": "dist/node/index.node.js",
6
6
  "module": "dist/node/index.node.js",
@@ -30,6 +30,12 @@
30
30
  "default": "./dist/node/index.node.js"
31
31
  },
32
32
  "default": "./dist/node/index.node.js"
33
+ },
34
+ "./*.css": "./dist/*.css",
35
+ "./*": {
36
+ "types": "./dist/*.d.ts",
37
+ "import": "./dist/*.js",
38
+ "default": "./dist/*.js"
33
39
  }
34
40
  },
35
41
  "files": [
@@ -46,7 +52,7 @@
46
52
  },
47
53
  "sideEffects": false,
48
54
  "dependencies": {
49
- "@elizaos/core": "2.0.0-beta.1",
55
+ "@elizaos/core": "2.0.11-beta.7",
50
56
  "@neynar/nodejs-sdk": "^3.34.0",
51
57
  "lru-cache": "^11.1.0",
52
58
  "zod": "^4.4.3"
@@ -63,9 +69,9 @@
63
69
  "clean": "rm -rf dist .turbo .turbo-tsconfig.json tsconfig.tsbuildinfo",
64
70
  "format": "bunx @biomejs/biome format --write .",
65
71
  "format:check": "bunx @biomejs/biome format .",
66
- "typecheck": "tsc --noEmit -p tsconfig.json",
67
- "test": "npx -y vitest@4.0.18 run --passWithNoTests",
68
- "test:unit": "npx -y vitest@4.0.18 run __tests__ --passWithNoTests",
72
+ "typecheck": "tsgo --noEmit -p tsconfig.json",
73
+ "test": "npx -y vitest@4.0.18 run",
74
+ "test:unit": "npx -y vitest@4.0.18 run __tests__",
69
75
  "test:integration": "echo 'No integration tests'",
70
76
  "test:watch": "vitest",
71
77
  "lint": "bunx @biomejs/biome check --write --unsafe .",
@@ -183,7 +189,7 @@
183
189
  }
184
190
  }
185
191
  },
186
- "gitHead": "646c632924826e2b75c2304a75ee56959fe4a460",
192
+ "gitHead": "cdbc876f793d96073d7eb0d09715a031ce0cd32e",
187
193
  "eliza": {
188
194
  "platforms": [
189
195
  "browser",
@@ -1,2 +0,0 @@
1
- export declare const farcasterActions: any[];
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,OAAK,CAAC"}
@@ -1,4 +0,0 @@
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
@@ -1 +0,0 @@
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,16 +0,0 @@
1
- // index.browser.ts
2
- import { logger } from "@elizaos/core";
3
- var farcasterPlugin = {
4
- name: "farcaster",
5
- description: "Farcaster client plugin (browser: stub, use a server proxy)",
6
- async init(_config, _runtime) {
7
- logger.warn("[plugin-farcaster] This plugin is not supported directly in browsers. Use a server proxy.");
8
- }
9
- };
10
- var index_browser_default = farcasterPlugin;
11
- export {
12
- farcasterPlugin,
13
- index_browser_default as default
14
- };
15
-
16
- //# debugId=24315B60950B4B5564756E2164756E21
@@ -1,10 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../index.browser.ts"],
4
- "sourcesContent": [
5
- "import type { IAgentRuntime, Plugin } from \"@elizaos/core\";\nimport { logger } from \"@elizaos/core\";\n\nexport type {\n Cast,\n CastEmbed,\n CastId,\n FarcasterConfig,\n FarcasterEventTypes,\n FarcasterMessageType,\n FidRequest,\n Profile,\n} from \"./types\";\n\n/**\n * Browser-safe stub.\n *\n * The full Farcaster integration depends on server-side credentials and the Neynar SDK.\n * In browsers, import should succeed, but usage should be disabled (use a server proxy).\n */\nexport const farcasterPlugin: Plugin = {\n name: \"farcaster\",\n description: \"Farcaster client plugin (browser: stub, use a server proxy)\",\n async init(_config, _runtime: IAgentRuntime): Promise<void> {\n logger.warn(\n \"[plugin-farcaster] This plugin is not supported directly in browsers. Use a server proxy.\"\n );\n },\n};\n\nexport default farcasterPlugin;\n"
6
- ],
7
- "mappings": ";AACA;AAmBO,IAAM,kBAA0B;AAAA,EACrC,MAAM;AAAA,EACN,aAAa;AAAA,OACP,KAAI,CAAC,SAAS,UAAwC;AAAA,IAC1D,OAAO,KACL,2FACF;AAAA;AAEJ;AAEA,IAAe;",
8
- "debugId": "24315B60950B4B5564756E2164756E21",
9
- "names": []
10
- }
@@ -1,2 +0,0 @@
1
- export * from "../index.browser";
2
- export { default } from "../index.browser";
@@ -1,2 +0,0 @@
1
- export * from "../index.node";
2
- export { default } from "../index.node";