@elizaos/plugin-farcaster 1.7.2 → 2.0.0-alpha.1
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/dist/browser/index.browser.js +16 -0
- package/dist/browser/index.browser.js.map +10 -0
- package/dist/browser/index.d.ts +2 -0
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.node.cjs +2351 -0
- package/dist/cjs/index.node.js.map +34 -0
- package/dist/index.d.ts +2 -15
- package/dist/node/index.d.ts +2 -0
- package/dist/{index.js → node/index.node.js} +1056 -1609
- package/dist/node/index.node.js.map +34 -0
- package/package.json +67 -46
- package/LICENSE +0 -21
- package/README.md +0 -310
- package/dist/__tests__/e2e/scenarios.d.ts +0 -4
- package/dist/__tests__/e2e/scenarios.d.ts.map +0 -1
- package/dist/__tests__/suite.d.ts +0 -130
- package/dist/__tests__/suite.d.ts.map +0 -1
- package/dist/__tests__/test-utils.d.ts +0 -29
- package/dist/__tests__/test-utils.d.ts.map +0 -1
- package/dist/__tests__/types.d.ts +0 -88
- package/dist/__tests__/types.d.ts.map +0 -1
- package/dist/actions/index.d.ts +0 -4
- package/dist/actions/index.d.ts.map +0 -1
- package/dist/actions/replyCast.d.ts +0 -3
- package/dist/actions/replyCast.d.ts.map +0 -1
- package/dist/actions/sendCast.d.ts +0 -3
- package/dist/actions/sendCast.d.ts.map +0 -1
- package/dist/client.d.ts +0 -26
- package/dist/client.d.ts.map +0 -1
- package/dist/common/asyncqueue.d.ts +0 -13
- package/dist/common/asyncqueue.d.ts.map +0 -1
- package/dist/common/callbacks.d.ts +0 -14
- package/dist/common/callbacks.d.ts.map +0 -1
- package/dist/common/config.d.ts +0 -24
- package/dist/common/config.d.ts.map +0 -1
- package/dist/common/constants.d.ts +0 -9
- package/dist/common/constants.d.ts.map +0 -1
- package/dist/common/prompts.d.ts +0 -5
- package/dist/common/prompts.d.ts.map +0 -1
- package/dist/common/types.d.ts +0 -106
- package/dist/common/types.d.ts.map +0 -1
- package/dist/common/utils.d.ts +0 -28
- package/dist/common/utils.d.ts.map +0 -1
- package/dist/events/messageHandler.d.ts +0 -29
- package/dist/events/messageHandler.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -36
- package/dist/managers/agent.d.ts +0 -21
- package/dist/managers/agent.d.ts.map +0 -1
- package/dist/managers/embedManager.d.ts +0 -89
- package/dist/managers/embedManager.d.ts.map +0 -1
- package/dist/managers/interaction-processor.d.ts +0 -12
- package/dist/managers/interaction-processor.d.ts.map +0 -1
- package/dist/managers/interaction-source.d.ts +0 -50
- package/dist/managers/interaction-source.d.ts.map +0 -1
- package/dist/managers/interactions.d.ts +0 -50
- package/dist/managers/interactions.d.ts.map +0 -1
- package/dist/managers/post.d.ts +0 -24
- package/dist/managers/post.d.ts.map +0 -1
- package/dist/providers/index.d.ts +0 -5
- 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/providers/threadProvider.d.ts +0 -3
- package/dist/providers/threadProvider.d.ts.map +0 -1
- package/dist/providers/timelineProvider.d.ts +0 -3
- package/dist/providers/timelineProvider.d.ts.map +0 -1
- package/dist/routes/webhook.d.ts +0 -3
- package/dist/routes/webhook.d.ts.map +0 -1
- package/dist/service.d.ts +0 -31
- package/dist/service.d.ts.map +0 -1
- package/dist/services/CastService.d.ts +0 -142
- package/dist/services/CastService.d.ts.map +0 -1
- package/dist/services/MessageService.d.ts +0 -50
- package/dist/services/MessageService.d.ts.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"asyncqueue.d.ts","sourceRoot":"","sources":["../../src/common/asyncqueue.ts"],"names":[],"mappings":"AAAA,qBAAa,UAAU;IACrB,OAAO,CAAC,KAAK,CAA+B;IAC5C,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,cAAc,CAAsB;IAC5C,OAAO,CAAC,aAAa,CAAS;gBAElB,aAAa,GAAE,MAAU;IAI/B,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;YAarC,UAAU;IAsBlB,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC;IAIvB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IAUxC,OAAO,CAAC,qBAAqB;CAQ9B"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { HandlerCallback, IAgentRuntime, Memory, UUID } from '@elizaos/core';
|
|
2
|
-
import { Cast as NeynarCast } from '@neynar/nodejs-sdk/build/api';
|
|
3
|
-
import { FarcasterClient } from '../client';
|
|
4
|
-
import { CastId, FarcasterConfig } from './types';
|
|
5
|
-
export declare function standardCastHandlerCallback({ client, runtime, config, roomId, onCompletion, onError, inReplyTo, }: {
|
|
6
|
-
inReplyTo?: CastId;
|
|
7
|
-
client: FarcasterClient;
|
|
8
|
-
runtime: IAgentRuntime;
|
|
9
|
-
config: FarcasterConfig;
|
|
10
|
-
roomId: UUID;
|
|
11
|
-
onCompletion?: (casts: NeynarCast[], memories: Memory[]) => Promise<void>;
|
|
12
|
-
onError?: (error: unknown) => Promise<void>;
|
|
13
|
-
}): HandlerCallback;
|
|
14
|
-
//# sourceMappingURL=callbacks.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"callbacks.d.ts","sourceRoot":"","sources":["../../src/common/callbacks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,eAAe,EAAE,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACtF,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAGlD,wBAAgB,2BAA2B,CAAC,EAC1C,MAAM,EACN,OAAO,EACP,MAAM,EACN,MAAM,EACN,YAAY,EACZ,OAAO,EACP,SAAS,GACV,EAAE;IACD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,eAAe,CAAC;IACxB,OAAO,EAAE,aAAa,CAAC;IACvB,MAAM,EAAE,eAAe,CAAC;IACxB,MAAM,EAAE,IAAI,CAAC;IACb,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1E,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7C,GAAG,eAAe,CAqDlB"}
|
package/dist/common/config.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { type IAgentRuntime } from '@elizaos/core';
|
|
2
|
-
import { FarcasterConfig } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Gets the Farcaster FID from runtime settings.
|
|
5
|
-
* Uses getSetting which already prioritizes: character.secrets -> character.settings -> env vars
|
|
6
|
-
*/
|
|
7
|
-
export declare function getFarcasterFid(runtime: IAgentRuntime): number | null;
|
|
8
|
-
/**
|
|
9
|
-
* Checks if Farcaster is properly configured for this runtime.
|
|
10
|
-
* getSetting already handles priority: character.secrets -> character.settings -> env vars
|
|
11
|
-
*/
|
|
12
|
-
export declare function hasFarcasterEnabled(runtime: IAgentRuntime): boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Constructs and validates a Farcaster configuration object using runtime settings and environment variables.
|
|
15
|
-
*
|
|
16
|
-
* Retrieves configuration values for the Farcaster client, applying defaults where necessary, and validates them against the {@link FarcasterConfigSchema}. Throws a detailed error if validation fails.
|
|
17
|
-
*
|
|
18
|
-
* @param runtime - The runtime environment providing configuration settings.
|
|
19
|
-
* @returns The validated {@link FarcasterConfig} object.
|
|
20
|
-
*
|
|
21
|
-
* @throws {Error} If configuration validation fails, with details about each invalid field.
|
|
22
|
-
*/
|
|
23
|
-
export declare function validateFarcasterConfig(runtime: IAgentRuntime): FarcasterConfig;
|
|
24
|
-
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/common/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAQzE,OAAO,EAAE,eAAe,EAAyB,MAAM,SAAS,CAAC;AAQjE;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,GAAG,IAAI,CAKrE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAUnE;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,aAAa,GAAG,eAAe,CAsG/E"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const FARCASTER_SERVICE_NAME = "farcaster";
|
|
2
|
-
export declare const FARCASTER_SOURCE = "farcaster";
|
|
3
|
-
export declare const DEFAULT_MAX_CAST_LENGTH = 320;
|
|
4
|
-
export declare const DEFAULT_POLL_INTERVAL = 120;
|
|
5
|
-
export declare const DEFAULT_CAST_INTERVAL_MIN = 90;
|
|
6
|
-
export declare const DEFAULT_CAST_INTERVAL_MAX = 180;
|
|
7
|
-
export declare const DEFAULT_CAST_CACHE_TTL: number;
|
|
8
|
-
export declare const DEFAULT_CAST_CACHE_SIZE = 9000;
|
|
9
|
-
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/common/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,cAAc,CAAC;AAClD,eAAO,MAAM,gBAAgB,cAAc,CAAC;AAC5C,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAC3C,eAAO,MAAM,qBAAqB,MAAM,CAAC;AACzC,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAC5C,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAC7C,eAAO,MAAM,sBAAsB,QAAiB,CAAC;AACrD,eAAO,MAAM,uBAAuB,OAAO,CAAC"}
|
package/dist/common/prompts.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { type Character } from '@elizaos/core';
|
|
2
|
-
import type { Cast } from './types';
|
|
3
|
-
export declare const formatCast: (cast: Cast) => string;
|
|
4
|
-
export declare const formatTimeline: (character: Character, timeline: Cast[]) => string;
|
|
5
|
-
//# sourceMappingURL=prompts.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/common/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEpC,eAAO,MAAM,UAAU,GAAI,MAAM,IAAI,WAIpC,CAAC;AAEF,eAAO,MAAM,cAAc,GACzB,WAAW,SAAS,EACpB,UAAU,IAAI,EAAE,WAGjB,CAAC"}
|
package/dist/common/types.d.ts
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { type Media, Memory, MessagePayload } from '@elizaos/core';
|
|
2
|
-
import { Cast as NeynarCast, Embed as NeynarEmbed } from '@neynar/nodejs-sdk/build/api';
|
|
3
|
-
import { z } from 'zod';
|
|
4
|
-
export type Profile = {
|
|
5
|
-
fid: number;
|
|
6
|
-
name: string;
|
|
7
|
-
username: string;
|
|
8
|
-
pfp?: string;
|
|
9
|
-
bio?: string;
|
|
10
|
-
url?: string;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Embed types that can be attached to a cast
|
|
14
|
-
*/
|
|
15
|
-
export type CastEmbed = {
|
|
16
|
-
/** Type of embed: image, video, url, cast (quote), frame */
|
|
17
|
-
type: 'image' | 'video' | 'audio' | 'url' | 'cast' | 'frame' | 'unknown';
|
|
18
|
-
/** URL of the embedded content */
|
|
19
|
-
url: string;
|
|
20
|
-
/** For embedded casts, the cast hash */
|
|
21
|
-
castHash?: string;
|
|
22
|
-
/** Metadata about the embed from Neynar */
|
|
23
|
-
metadata?: {
|
|
24
|
-
contentType?: string;
|
|
25
|
-
width?: number;
|
|
26
|
-
height?: number;
|
|
27
|
-
duration?: number;
|
|
28
|
-
title?: string;
|
|
29
|
-
description?: string;
|
|
30
|
-
authorFid?: number;
|
|
31
|
-
authorUsername?: string;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
export type Cast = {
|
|
35
|
-
hash: string;
|
|
36
|
-
authorFid: number;
|
|
37
|
-
text: string;
|
|
38
|
-
profile: Profile;
|
|
39
|
-
threadId?: string;
|
|
40
|
-
inReplyTo?: {
|
|
41
|
-
hash: string;
|
|
42
|
-
fid: number;
|
|
43
|
-
};
|
|
44
|
-
timestamp: Date;
|
|
45
|
-
stats?: {
|
|
46
|
-
recasts: number;
|
|
47
|
-
replies: number;
|
|
48
|
-
likes: number;
|
|
49
|
-
};
|
|
50
|
-
/** Raw embeds from Neynar API */
|
|
51
|
-
embeds?: NeynarEmbed[];
|
|
52
|
-
/** Processed media attachments ready for elizaos Memory */
|
|
53
|
-
media?: Media[];
|
|
54
|
-
};
|
|
55
|
-
export type CastId = {
|
|
56
|
-
hash: string;
|
|
57
|
-
fid: number;
|
|
58
|
-
};
|
|
59
|
-
export type FidRequest = {
|
|
60
|
-
fid: number;
|
|
61
|
-
pageSize: number;
|
|
62
|
-
};
|
|
63
|
-
export interface LastCast {
|
|
64
|
-
hash: string;
|
|
65
|
-
timestamp: number;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* This schema defines all required/optional environment settings for Farcaster client
|
|
69
|
-
*/
|
|
70
|
-
export declare const FarcasterConfigSchema: any;
|
|
71
|
-
export type FarcasterConfig = z.infer<typeof FarcasterConfigSchema>;
|
|
72
|
-
export declare enum FarcasterEventTypes {
|
|
73
|
-
CAST_GENERATED = "FARCASTER_CAST_GENERATED",
|
|
74
|
-
MENTION_RECEIVED = "FARCASTER_MENTION_RECEIVED",
|
|
75
|
-
THREAD_CAST_CREATED = "FARCASTER_THREAD_CAST_CREATED"
|
|
76
|
-
}
|
|
77
|
-
export declare enum FarcasterMessageType {
|
|
78
|
-
CAST = "CAST",
|
|
79
|
-
REPLY = "REPLY"
|
|
80
|
-
}
|
|
81
|
-
export interface FarcasterGenericCastPayload extends Omit<MessagePayload, 'message'> {
|
|
82
|
-
memory: Memory;
|
|
83
|
-
cast: NeynarCast;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Neynar webhook data structure for cast events
|
|
87
|
-
*/
|
|
88
|
-
export interface NeynarWebhookData {
|
|
89
|
-
type: string;
|
|
90
|
-
data?: {
|
|
91
|
-
hash: string;
|
|
92
|
-
text?: string;
|
|
93
|
-
author: {
|
|
94
|
-
fid: number;
|
|
95
|
-
username?: string;
|
|
96
|
-
};
|
|
97
|
-
mentioned_profiles?: Array<{
|
|
98
|
-
fid: number;
|
|
99
|
-
}>;
|
|
100
|
-
parent_hash?: string;
|
|
101
|
-
parent_author?: {
|
|
102
|
-
fid: number;
|
|
103
|
-
};
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/common/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAGnE,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,8BAA8B,CAAC;AACxF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;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AW,CAAC,EAAE,MAAM,CAAC;QACrB,aAAa,CAAC,EAAE;YAAE,GAAG,EAAE,MAAM,CAAA;SAAE,CAAC;KACjC,CAAC;CACH"}
|
package/dist/common/utils.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { IAgentRuntime, Memory, UUID } from '@elizaos/core';
|
|
2
|
-
import { Cast as NeynarCast } from '@neynar/nodejs-sdk/build/api';
|
|
3
|
-
import { Cast } from './types';
|
|
4
|
-
export declare const MAX_CAST_LENGTH = 1024;
|
|
5
|
-
export declare function castId({ hash, agentId }: {
|
|
6
|
-
hash: string;
|
|
7
|
-
agentId: string;
|
|
8
|
-
}): string;
|
|
9
|
-
export declare function castUuid(props: {
|
|
10
|
-
hash: string;
|
|
11
|
-
agentId: string;
|
|
12
|
-
}): any;
|
|
13
|
-
export declare function splitPostContent(content: string, maxLength?: number): string[];
|
|
14
|
-
export declare function splitParagraph(paragraph: string, maxLength: number): string[];
|
|
15
|
-
export declare function lastCastCacheKey(fid: number): string;
|
|
16
|
-
/**
|
|
17
|
-
* Convert a Neynar Cast to our internal Cast type
|
|
18
|
-
* Now includes embeds from the original cast for media processing
|
|
19
|
-
*/
|
|
20
|
-
export declare function neynarCastToCast(neynarCast: NeynarCast): Cast;
|
|
21
|
-
export declare function createCastMemory({ roomId, senderId, runtime, cast, }: {
|
|
22
|
-
roomId: UUID;
|
|
23
|
-
senderId: UUID;
|
|
24
|
-
runtime: IAgentRuntime;
|
|
25
|
-
cast: Cast;
|
|
26
|
-
}): Memory;
|
|
27
|
-
export declare function formatCastTimestamp(timestamp: Date): string;
|
|
28
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/common/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,EAAgB,IAAI,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAElE,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,eAAO,MAAM,eAAe,OAAO,CAAC;AAEpC,wBAAgB,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,UAE1E;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,OAEhE;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,GAAE,MAAwB,GAAG,MAAM,EAAE,CAkC/F;AAED,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CA6C7E;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,UAE3C;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAyB7D;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,QAAQ,EACR,OAAO,EACP,IAAI,GACL,EAAE;IACD,MAAM,EAAE,IAAI,CAAC;IACb,QAAQ,EAAE,IAAI,CAAC;IACf,OAAO,EAAE,aAAa,CAAC;IACvB,IAAI,EAAE,IAAI,CAAC;CACZ,GAAG,MAAM,CA2BT;AAED,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,IAAI,GAAG,MAAM,CAO3D"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { type IAgentRuntime, type Memory, type MessagePayload, type UUID } from '@elizaos/core';
|
|
2
|
-
/**
|
|
3
|
-
* Handles when a Farcaster message is sent by the agent
|
|
4
|
-
* Stores metadata to connect the sent message with its cast hash
|
|
5
|
-
*/
|
|
6
|
-
export declare const handleCastSent: (payload: {
|
|
7
|
-
runtime: IAgentRuntime;
|
|
8
|
-
castHash: string;
|
|
9
|
-
message: Memory;
|
|
10
|
-
threadId?: string;
|
|
11
|
-
}) => Promise<void>;
|
|
12
|
-
/**
|
|
13
|
-
* Handles incoming Farcaster messages and enriches them with metadata
|
|
14
|
-
*/
|
|
15
|
-
export declare const handleCastReceived: (payload: MessagePayload) => Promise<void>;
|
|
16
|
-
/**
|
|
17
|
-
* Links reply casts to their parent conversations
|
|
18
|
-
*/
|
|
19
|
-
export declare const handleReplyTracking: (payload: {
|
|
20
|
-
runtime: IAgentRuntime;
|
|
21
|
-
replyCastHash: string;
|
|
22
|
-
parentCastHash: string;
|
|
23
|
-
roomId: UUID;
|
|
24
|
-
}) => Promise<void>;
|
|
25
|
-
/**
|
|
26
|
-
* Register all Farcaster event handlers
|
|
27
|
-
*/
|
|
28
|
-
export declare const registerFarcasterEventHandlers: (runtime: IAgentRuntime) => void;
|
|
29
|
-
//# sourceMappingURL=messageHandler.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"messageHandler.d.ts","sourceRoot":"","sources":["../../src/events/messageHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAElB,KAAK,MAAM,EACX,KAAK,cAAc,EACnB,KAAK,IAAI,EACV,MAAM,eAAe,CAAC;AAGvB;;;GAGG;AACH,eAAO,MAAM,cAAc,GAAU,SAAS;IAC5C,OAAO,EAAE,aAAa,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,KAAG,OAAO,CAAC,IAAI,CAkCf,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAU,SAAS,cAAc,KAAG,OAAO,CAAC,IAAI,CAyC9E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAAU,SAAS;IACjD,OAAO,EAAE,aAAa,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,IAAI,CAAC;CACd,KAAG,OAAO,CAAC,IAAI,CAiCf,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,8BAA8B,GAAI,SAAS,aAAa,KAAG,IAKvE,CAAC"}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAM1D,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACxG,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEnF,QAAA,MAAM,eAAe;;;;;;;;CAQpB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|