@elizaos/plugin-farcaster 2.0.0-alpha.8 → 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.
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,75 @@
1
+ # @elizaos/plugin-farcaster
2
+
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
+
5
+ ## Capabilities
6
+
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.
15
+
16
+ ## Installation
17
+
18
+ ```bash
19
+ bun add @elizaos/plugin-farcaster
20
+ ```
21
+
22
+ ## Configuration
23
+
24
+ The plugin is auto-enabled when a `farcaster` connector block is present in the agent config. Register it manually if needed:
25
+
26
+ ```typescript
27
+ import farcasterPlugin from "@elizaos/plugin-farcaster";
28
+
29
+ const agent = new AgentRuntime({
30
+ plugins: [farcasterPlugin],
31
+ // ...
32
+ });
33
+ ```
34
+
35
+ ### Environment variables
36
+
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 |
54
+
55
+ For multi-account setups, prefix any variable with `FARCASTER_<ACCOUNT_ID>_` (e.g. `FARCASTER_MYACCT_FID`).
56
+
57
+ ### Webhook mode
58
+
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.
60
+
61
+ ## Providers
62
+
63
+ ### `farcasterProfile`
64
+
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.
66
+
67
+ ## Development
68
+
69
+ ```bash
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
75
+ ```
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
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elizaos/plugin-farcaster",
3
- "version": "2.0.0-alpha.8",
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",
@@ -13,6 +13,7 @@
13
13
  "./package.json": "./package.json",
14
14
  ".": {
15
15
  "types": "./dist/node/index.d.ts",
16
+ "import": "./dist/node/index.node.js",
16
17
  "browser": {
17
18
  "types": "./dist/browser/index.d.ts",
18
19
  "import": "./dist/browser/index.browser.js",
@@ -25,36 +26,52 @@
25
26
  },
26
27
  "bun": {
27
28
  "types": "./dist/node/index.d.ts",
29
+ "import": "./dist/node/index.node.js",
28
30
  "default": "./dist/node/index.node.js"
29
31
  },
30
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"
31
39
  }
32
40
  },
33
41
  "files": [
34
- "dist"
42
+ "dist",
43
+ "auto-enable.ts"
35
44
  ],
45
+ "elizaos": {
46
+ "plugin": {
47
+ "autoEnableModule": "./auto-enable.ts",
48
+ "capabilities": [
49
+ "social-posting"
50
+ ]
51
+ }
52
+ },
36
53
  "sideEffects": false,
37
54
  "dependencies": {
38
- "@elizaos/core": "2.0.0-alpha.3",
55
+ "@elizaos/core": "2.0.11-beta.7",
39
56
  "@neynar/nodejs-sdk": "^3.34.0",
40
57
  "lru-cache": "^11.1.0",
41
- "typescript": "^5.9.3",
42
- "zod": "^4.3.6"
58
+ "zod": "^4.4.3"
43
59
  },
44
60
  "devDependencies": {
45
- "@biomejs/biome": "^2.3.11",
61
+ "@biomejs/biome": "^2.4.14",
46
62
  "@types/node": "^25.0.3",
47
- "esbuild": "^0.25.0",
63
+ "esbuild": "^0.28.0",
64
+ "typescript": "^6.0.3",
48
65
  "vitest": "^4.0.0"
49
66
  },
50
67
  "scripts": {
51
68
  "dev": "bun run build.ts --watch",
52
- "clean": "rm -rf dist .turbo node_modules .turbo-tsconfig.json tsconfig.tsbuildinfo",
69
+ "clean": "rm -rf dist .turbo .turbo-tsconfig.json tsconfig.tsbuildinfo",
53
70
  "format": "bunx @biomejs/biome format --write .",
54
71
  "format:check": "bunx @biomejs/biome format .",
55
- "typecheck": "tsc --noEmit -p tsconfig.json",
56
- "test": "npx -y vitest@4.0.18 run --passWithNoTests",
57
- "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__",
58
75
  "test:integration": "echo 'No integration tests'",
59
76
  "test:watch": "vitest",
60
77
  "lint": "bunx @biomejs/biome check --write --unsafe .",
@@ -172,8 +189,8 @@
172
189
  }
173
190
  }
174
191
  },
175
- "gitHead": "646c632924826e2b75c2304a75ee56959fe4a460",
176
- "milady": {
192
+ "gitHead": "cdbc876f793d96073d7eb0d09715a031ce0cd32e",
193
+ "eliza": {
177
194
  "platforms": [
178
195
  "browser",
179
196
  "node"
@@ -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";