@@ -6,50 +6,52 @@ import { InstagramInteractionService } from "./services/interaction";
6
6
import { InstagramPostService } from "./services/post" ;
7
7
8
8
export const InstagramClientInterface : Client = {
9
- async start ( runtime : IAgentRuntime ) {
10
- try {
11
- // Validate configuration
12
- const config = await validateInstagramConfig ( runtime ) ;
13
- elizaLogger . log ( "Instagram client configuration validated" ) ;
14
-
15
- // Initialize client and get initial state
16
- const state = await initializeClient ( runtime , config ) ;
17
- elizaLogger . log ( "Instagram client initialized" ) ;
18
-
19
- // Create services
20
- const postService = new InstagramPostService ( runtime , state ) ;
21
- const interactionService = new InstagramInteractionService ( runtime , state ) ;
22
-
23
- // Start services
24
- if ( ! config . INSTAGRAM_DRY_RUN ) {
25
- await postService . start ( ) ;
26
- elizaLogger . log ( "Instagram post service started" ) ;
27
-
28
- if ( config . INSTAGRAM_ENABLE_ACTION_PROCESSING ) {
29
- await interactionService . start ( ) ;
30
- elizaLogger . log ( "Instagram interaction service started" ) ;
9
+ async start ( runtime : IAgentRuntime ) {
10
+ try {
11
+ // Validate configuration
12
+ const config = await validateInstagramConfig ( runtime ) ;
13
+ elizaLogger . log ( "Instagram client configuration validated" ) ;
14
+
15
+ // Initialize client and get initial state
16
+ const state = await initializeClient ( runtime , config ) ;
17
+ elizaLogger . log ( "Instagram client initialized" ) ;
18
+
19
+ // Create services
20
+ const postService = new InstagramPostService ( runtime , state ) ;
21
+ const interactionService = new InstagramInteractionService (
22
+ runtime ,
23
+ state
24
+ ) ;
25
+
26
+ // Start services
27
+ if ( ! config . INSTAGRAM_DRY_RUN ) {
28
+ await postService . start ( ) ;
29
+ elizaLogger . log ( "Instagram post service started" ) ;
30
+
31
+ if ( config . INSTAGRAM_ENABLE_ACTION_PROCESSING ) {
32
+ await interactionService . start ( ) ;
33
+ elizaLogger . log ( "Instagram interaction service started" ) ;
34
+ }
35
+ } else {
36
+ elizaLogger . log ( "Instagram client running in dry-run mode" ) ;
37
+ }
38
+
39
+ // Return manager instance
40
+ return {
41
+ post : postService ,
42
+ interaction : interactionService ,
43
+ state,
44
+ } ;
45
+ } catch ( error ) {
46
+ elizaLogger . error ( "Failed to start Instagram client:" , error ) ;
47
+ throw error ;
31
48
}
32
- } else {
33
- elizaLogger . log ( "Instagram client running in dry-run mode" ) ;
34
- }
35
-
36
- // Return manager instance
37
- return {
38
- post : postService ,
39
- interaction : interactionService ,
40
- state
41
- } ;
42
-
43
- } catch ( error ) {
44
- elizaLogger . error ( "Failed to start Instagram client:" , error ) ;
45
- throw error ;
46
- }
47
- } ,
48
-
49
- async stop ( runtime : IAgentRuntime ) {
50
- elizaLogger . log ( "Stopping Instagram client services..." ) ;
51
- // Cleanup will be handled by the services themselves
52
- }
49
+ } ,
50
+
51
+ async stop ( _runtime : IAgentRuntime ) {
52
+ elizaLogger . log ( "Stopping Instagram client services..." ) ;
53
+ // Cleanup will be handled by the services themselves
54
+ } ,
53
55
} ;
54
56
55
- export default InstagramClientInterface ;
57
+ export default InstagramClientInterface ;
0 commit comments