@elizaos/plugin-farcaster 1.0.0-beta.52 → 1.0.0-beta.54

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 CHANGED
@@ -1,17 +1,17 @@
1
- # ElizaOS Farcaster Client
1
+ # ElizaOS Farcaster Plugin
2
2
 
3
3
  A plugin for ElizaOS that enables agent integration with the Farcaster social network.
4
4
 
5
5
  ## Overview
6
6
 
7
- The ElizaOS Farcaster Client allows AI agents to interact with the Farcaster social network by:
7
+ The ElizaOS Farcaster Plugin allows AI agents to interact with the Farcaster social network by:
8
8
 
9
9
  - Publishing original casts (posts)
10
10
  - Responding to mentions and replies
11
11
  - Interacting with other users' content
12
12
  - Processing user engagement automatically
13
13
 
14
- This client leverages the [Neynar API](https://neynar.com) to interact with Farcaster, providing a robust integration between ElizaOS agents and the Farcaster social graph.
14
+ This plugin leverages the [Neynar API](https://neynar.com) to interact with Farcaster, providing a robust integration between ElizaOS agents and the Farcaster social graph.
15
15
 
16
16
  ## Features
17
17
 
@@ -25,12 +25,12 @@ This client leverages the [Neynar API](https://neynar.com) to interact with Farc
25
25
  ## Installation
26
26
 
27
27
  ```bash
28
- npm install @elizaos-plugins/client-farcaster
28
+ npm install @elizaos/plugin-farcaster
29
29
  ```
30
30
 
31
31
  ## Configuration
32
32
 
33
- The client requires the following configurations, which can be set via environment variables or ElizaOS runtime settings:
33
+ The plugin requires the following configurations, which can be set via environment variables or ElizaOS runtime settings:
34
34
 
35
35
  ### Required Settings
36
36
 
@@ -0,0 +1,96 @@
1
+ import { Service, IAgentRuntime, TestSuite } from '@elizaos/core';
2
+
3
+ declare class FarcasterService extends Service {
4
+ private static instance?;
5
+ private managers;
6
+ static serviceType: string;
7
+ readonly capabilityDescription = "The agent is able to send and receive messages on farcaster";
8
+ private static getInstance;
9
+ static start(runtime: IAgentRuntime): Promise<Service>;
10
+ static stop(runtime: IAgentRuntime): Promise<void>;
11
+ stop(): Promise<void>;
12
+ }
13
+
14
+ /**
15
+ * Represents a Test Suite for Farcaster functionality.
16
+ * This class implements the TestSuite interface.
17
+ * It contains various test cases related to Farcaster operations such as initializing the client,
18
+ * fetching profile, fetching casts, posting casts, and handling cast interactions.
19
+ */
20
+ declare class FarcasterTestSuite implements TestSuite {
21
+ name: string;
22
+ private manager;
23
+ tests: {
24
+ name: string;
25
+ fn: (runtime: IAgentRuntime) => Promise<void>;
26
+ }[];
27
+ /**
28
+ * Constructor for TestSuite class.
29
+ * Initializes an array of test functions to be executed.
30
+ */
31
+ constructor();
32
+ /**
33
+ * Asynchronously initializes the Farcaster client for the provided agent runtime.
34
+ *
35
+ * @param {IAgentRuntime} runtime - The agent runtime to use for initializing the Farcaster client.
36
+ * @throws {Error} If the Farcaster client manager is not found or if the Farcaster client fails to initialize.
37
+ */
38
+ testInitializingClient(runtime: IAgentRuntime): Promise<void>;
39
+ /**
40
+ * Asynchronously fetches the profile of a user from Farcaster using the given runtime.
41
+ *
42
+ * @param {IAgentRuntime} runtime The runtime to use for fetching the profile.
43
+ * @returns {Promise<void>} A Promise that resolves when the profile is successfully fetched, or rejects with an error.
44
+ */
45
+ testFetchProfile(runtime: IAgentRuntime): Promise<void>;
46
+ /**
47
+ * Asynchronously fetches the timeline from the Farcaster client.
48
+ *
49
+ * @param {IAgentRuntime} runtime - The agent runtime object.
50
+ * @throws {Error} If there are no casts in the timeline.
51
+ * @throws {Error} If an error occurs while fetching the timeline.
52
+ */
53
+ testFetchTimeline(runtime: IAgentRuntime): Promise<void>;
54
+ /**
55
+ * Asynchronously posts a test cast using the Farcaster API.
56
+ *
57
+ * @param {IAgentRuntime} runtime - The agent runtime object.
58
+ * @returns {Promise<void>} A Promise that resolves when the cast is successfully posted.
59
+ * @throws {Error} If there is an error posting the cast.
60
+ */
61
+ testPostCast(runtime: IAgentRuntime): Promise<void>;
62
+ /**
63
+ * Asynchronously posts an image cast on Farcaster using the provided runtime and cast content.
64
+ * Note: This might need updating based on how images are actually handled in sendCast
65
+ *
66
+ * @param {IAgentRuntime} runtime - The runtime environment for the action.
67
+ * @returns {Promise<void>} A Promise that resolves when the cast is successfully posted.
68
+ * @throws {Error} If there is an error posting the cast.
69
+ */
70
+ testPostImageCast(runtime: IAgentRuntime): Promise<void>;
71
+ /**
72
+ * Asynchronously handles a fake cast response using the given runtime.
73
+ *
74
+ * @param {IAgentRuntime} runtime - The runtime object for the agent
75
+ * @returns {Promise<void>} - A promise that resolves when the cast response is handled
76
+ * @throws {Error} - If there is an error handling the cast response
77
+ */
78
+ testHandleCastResponse(runtime: IAgentRuntime): Promise<void>;
79
+ /**
80
+ * Generates random content for a cast based on the given context.
81
+ *
82
+ * @param {IAgentRuntime} runtime - The runtime environment.
83
+ * @param {string} context - Optional context for the content generation.
84
+ * @returns {Promise<string>} A promise that resolves to the generated cast content.
85
+ */
86
+ private generateRandomCastContent;
87
+ }
88
+
89
+ declare const farcasterPlugin: {
90
+ name: string;
91
+ description: string;
92
+ services: (typeof FarcasterService)[];
93
+ tests: FarcasterTestSuite[];
94
+ };
95
+
96
+ export { farcasterPlugin as default };