@elizaos/plugin-farcaster 2.0.0-beta.1 → 2.0.3-beta.2
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/README.md +42 -75
- package/auto-enable.ts +1 -1
- package/package.json +12 -6
- package/dist/actions/index.d.ts +0 -2
- package/dist/actions/index.d.ts.map +0 -1
- package/dist/auto-enable.d.ts +0 -4
- package/dist/auto-enable.d.ts.map +0 -1
- package/dist/browser/index.browser.js +0 -16
- package/dist/browser/index.browser.js.map +0 -10
- package/dist/browser/index.d.ts +0 -2
- package/dist/cjs/index.d.ts +0 -2
- package/dist/cjs/index.node.cjs +0 -2555
- package/dist/cjs/index.node.js.map +0 -31
- package/dist/client/FarcasterClient.d.ts +0 -41
- package/dist/client/FarcasterClient.d.ts.map +0 -1
- package/dist/client/index.d.ts +0 -2
- package/dist/client/index.d.ts.map +0 -1
- package/dist/connector-account-provider.d.ts +0 -16
- package/dist/connector-account-provider.d.ts.map +0 -1
- package/dist/generated/specs/spec-helpers.d.ts +0 -36
- package/dist/generated/specs/spec-helpers.d.ts.map +0 -1
- package/dist/generated/specs/specs.d.ts +0 -48
- package/dist/generated/specs/specs.d.ts.map +0 -1
- package/dist/index.browser.d.ts +0 -11
- package/dist/index.browser.d.ts.map +0 -1
- package/dist/index.d.ts +0 -10
- package/dist/index.d.ts.map +0 -1
- package/dist/index.node.d.ts +0 -3
- package/dist/index.node.d.ts.map +0 -1
- package/dist/managers/AgentManager.d.ts +0 -20
- package/dist/managers/AgentManager.d.ts.map +0 -1
- package/dist/managers/CastManager.d.ts +0 -25
- package/dist/managers/CastManager.d.ts.map +0 -1
- package/dist/managers/EmbedManager.d.ts +0 -40
- package/dist/managers/EmbedManager.d.ts.map +0 -1
- package/dist/managers/InteractionManager.d.ts +0 -32
- package/dist/managers/InteractionManager.d.ts.map +0 -1
- package/dist/managers/InteractionProcessor.d.ts +0 -10
- package/dist/managers/InteractionProcessor.d.ts.map +0 -1
- package/dist/managers/InteractionSource.d.ts +0 -38
- package/dist/managers/InteractionSource.d.ts.map +0 -1
- package/dist/managers/index.d.ts +0 -7
- package/dist/managers/index.d.ts.map +0 -1
- package/dist/node/index.d.ts +0 -2
- package/dist/node/index.node.d.ts +0 -2
- package/dist/node/index.node.js +0 -2505
- package/dist/node/index.node.js.map +0 -31
- package/dist/providers/index.d.ts +0 -4
- package/dist/providers/index.d.ts.map +0 -1
- package/dist/providers/profileProvider.d.ts +0 -3
- package/dist/providers/profileProvider.d.ts.map +0 -1
- package/dist/routes/webhook.d.ts +0 -3
- package/dist/routes/webhook.d.ts.map +0 -1
- package/dist/services/CastService.d.ts +0 -133
- package/dist/services/CastService.d.ts.map +0 -1
- package/dist/services/FarcasterService.d.ts +0 -32
- package/dist/services/FarcasterService.d.ts.map +0 -1
- package/dist/services/MessageService.d.ts +0 -54
- package/dist/services/MessageService.d.ts.map +0 -1
- package/dist/services/index.d.ts +0 -4
- package/dist/services/index.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -119
- package/dist/types/index.d.ts.map +0 -1
- package/dist/utils/asyncqueue.d.ts +0 -13
- package/dist/utils/asyncqueue.d.ts.map +0 -1
- package/dist/utils/callbacks.d.ts +0 -14
- package/dist/utils/callbacks.d.ts.map +0 -1
- package/dist/utils/config.d.ts +0 -14
- package/dist/utils/config.d.ts.map +0 -1
- package/dist/utils/index.d.ts +0 -25
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/prompts.d.ts +0 -5
- package/dist/utils/prompts.d.ts.map +0 -1
- package/dist/workflow-credential-provider.d.ts +0 -21
- 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
|
-
|
|
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
|
-
##
|
|
5
|
+
## Capabilities
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
// ...
|
|
31
|
+
// ...
|
|
61
32
|
});
|
|
62
33
|
```
|
|
63
34
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
Farcaster public posts are exposed through the primary `POST` action:
|
|
35
|
+
### Environment variables
|
|
67
36
|
|
|
68
|
-
|
|
69
|
-
|
|
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
|
-
|
|
72
|
-
search primitive.
|
|
55
|
+
For multi-account setups, prefix any variable with `FARCASTER_<ACCOUNT_ID>_` (e.g. `FARCASTER_MYACCT_FID`).
|
|
73
56
|
|
|
74
|
-
|
|
57
|
+
### Webhook mode
|
|
75
58
|
|
|
76
|
-
|
|
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
|
-
|
|
61
|
+
## Providers
|
|
79
62
|
|
|
80
|
-
###
|
|
63
|
+
### `farcasterProfile`
|
|
81
64
|
|
|
82
|
-
|
|
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
|
-
#
|
|
90
|
-
bun run
|
|
91
|
-
#
|
|
92
|
-
bun run
|
|
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
|
|
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.
|
|
3
|
+
"version": "2.0.3-beta.2",
|
|
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.
|
|
55
|
+
"@elizaos/core": "2.0.3-beta.2",
|
|
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": "
|
|
67
|
-
"test": "npx -y vitest@4.0.18 run
|
|
68
|
-
"test:unit": "npx -y vitest@4.0.18 run __tests__
|
|
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": "
|
|
192
|
+
"gitHead": "82fe0f44215954c2417328203f5bd6510985c1fc",
|
|
187
193
|
"eliza": {
|
|
188
194
|
"platforms": [
|
|
189
195
|
"browser",
|
package/dist/actions/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,OAAK,CAAC"}
|
package/dist/auto-enable.d.ts
DELETED
|
@@ -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
|
-
}
|
package/dist/browser/index.d.ts
DELETED
package/dist/cjs/index.d.ts
DELETED