@framers/agentos-ext-channel-farcaster 0.1.0

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.
Files changed (39) hide show
  1. package/LICENSE +98 -0
  2. package/dist/FarcasterChannelAdapter.d.ts +50 -0
  3. package/dist/FarcasterChannelAdapter.d.ts.map +1 -0
  4. package/dist/FarcasterChannelAdapter.js +79 -0
  5. package/dist/FarcasterChannelAdapter.js.map +1 -0
  6. package/dist/FarcasterService.d.ts +60 -0
  7. package/dist/FarcasterService.d.ts.map +1 -0
  8. package/dist/FarcasterService.js +197 -0
  9. package/dist/FarcasterService.js.map +1 -0
  10. package/dist/index.d.ts +41 -0
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +112 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/tools/cast.d.ts +43 -0
  15. package/dist/tools/cast.d.ts.map +1 -0
  16. package/dist/tools/cast.js +39 -0
  17. package/dist/tools/cast.js.map +1 -0
  18. package/dist/tools/feed.d.ts +36 -0
  19. package/dist/tools/feed.d.ts.map +1 -0
  20. package/dist/tools/feed.js +35 -0
  21. package/dist/tools/feed.js.map +1 -0
  22. package/dist/tools/like.d.ts +29 -0
  23. package/dist/tools/like.d.ts.map +1 -0
  24. package/dist/tools/like.js +34 -0
  25. package/dist/tools/like.js.map +1 -0
  26. package/dist/tools/recast.d.ts +29 -0
  27. package/dist/tools/recast.d.ts.map +1 -0
  28. package/dist/tools/recast.js +34 -0
  29. package/dist/tools/recast.js.map +1 -0
  30. package/dist/tools/reply.d.ts +35 -0
  31. package/dist/tools/reply.d.ts.map +1 -0
  32. package/dist/tools/reply.js +35 -0
  33. package/dist/tools/reply.js.map +1 -0
  34. package/dist/tools/search.d.ts +35 -0
  35. package/dist/tools/search.d.ts.map +1 -0
  36. package/dist/tools/search.js +35 -0
  37. package/dist/tools/search.js.map +1 -0
  38. package/manifest.json +29 -0
  39. package/package.json +35 -0
package/LICENSE ADDED
@@ -0,0 +1,98 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
10
+
11
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
12
+
13
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
14
+
15
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
16
+
17
+ "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
18
+
19
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
20
+
21
+ "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
22
+
23
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
24
+
25
+ "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
26
+
27
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
28
+
29
+ 2. Grant of Copyright License.
30
+
31
+ Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
32
+
33
+ 3. Grant of Patent License.
34
+
35
+ Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
36
+
37
+ 4. Redistribution.
38
+
39
+ You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
40
+
41
+ (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
42
+
43
+ (b) You must cause any modified files to carry prominent notices stating that You changed the files; and
44
+
45
+ (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
46
+
47
+ (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
48
+
49
+ You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
50
+
51
+ 5. Submission of Contributions.
52
+
53
+ Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
54
+
55
+ 6. Trademarks.
56
+
57
+ This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
58
+
59
+ 7. Disclaimer of Warranty.
60
+
61
+ Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
62
+
63
+ 8. Limitation of Liability.
64
+
65
+ In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
66
+
67
+ 9. Accepting Warranty or Additional Liability.
68
+
69
+ While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
70
+
71
+ END OF TERMS AND CONDITIONS
72
+
73
+ APPENDIX: How to apply the Apache License to your work.
74
+
75
+ To apply the Apache License to your work, attach the following
76
+ boilerplate notice, with the fields enclosed by brackets "[]"
77
+ replaced with your own identifying information. (Don't include
78
+ the brackets!) The text should be enclosed in the appropriate
79
+ comment syntax for the file format. We also recommend that a
80
+ file or class name and description of purpose be included on the
81
+ same "printed page" as the copyright notice for easier
82
+ identification within third-party archives.
83
+
84
+ Copyright (c) 2025 Framers
85
+
86
+ Licensed under the Apache License, Version 2.0 (the "License");
87
+ you may not use this file except in compliance with the License.
88
+ You may obtain a copy of the License at
89
+
90
+ http://www.apache.org/licenses/LICENSE-2.0
91
+
92
+ Unless required by applicable law or agreed to in writing, software
93
+ distributed under the License is distributed on an "AS IS" BASIS,
94
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
95
+ See the License for the specific language governing permissions and
96
+ limitations under the License.
97
+
98
+
@@ -0,0 +1,50 @@
1
+ /**
2
+ * @fileoverview IChannelAdapter implementation for Farcaster.
3
+ */
4
+ import type { FarcasterService } from './FarcasterService.js';
5
+ export type ChannelPlatform = string;
6
+ export type ChannelCapability = string;
7
+ export type ChannelConnectionStatus = 'disconnected' | 'connecting' | 'connected' | 'reconnecting' | 'error';
8
+ export type ChannelEventType = string;
9
+ export interface ChannelAuthConfig {
10
+ platform: ChannelPlatform;
11
+ credential: string;
12
+ params?: Record<string, string>;
13
+ }
14
+ export interface ChannelConnectionInfo {
15
+ status: ChannelConnectionStatus;
16
+ connectedSince?: string;
17
+ errorMessage?: string;
18
+ platformInfo?: Record<string, unknown>;
19
+ }
20
+ export interface MessageContent {
21
+ blocks: Array<{
22
+ type: string;
23
+ [key: string]: any;
24
+ }>;
25
+ replyToMessageId?: string;
26
+ platformOptions?: Record<string, unknown>;
27
+ }
28
+ export interface ChannelSendResult {
29
+ messageId: string;
30
+ timestamp?: string;
31
+ }
32
+ export type ChannelEventHandler = (event: any) => void | Promise<void>;
33
+ export declare class FarcasterChannelAdapter {
34
+ readonly platform: ChannelPlatform;
35
+ readonly displayName = "Farcaster";
36
+ readonly capabilities: readonly ChannelCapability[];
37
+ private service;
38
+ private connectedAt;
39
+ private handlers;
40
+ private errorMessage;
41
+ constructor(service: FarcasterService);
42
+ initialize(_auth: ChannelAuthConfig): Promise<void>;
43
+ shutdown(): Promise<void>;
44
+ getConnectionInfo(): ChannelConnectionInfo;
45
+ sendMessage(conversationId: string, content: MessageContent): Promise<ChannelSendResult>;
46
+ sendTypingIndicator(_conversationId: string, _isTyping: boolean): Promise<void>;
47
+ on(handler: ChannelEventHandler, _eventTypes?: ChannelEventType[]): () => void;
48
+ addReaction(_conversationId: string, messageId: string, _emoji: string): Promise<void>;
49
+ }
50
+ //# sourceMappingURL=FarcasterChannelAdapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FarcasterChannelAdapter.d.ts","sourceRoot":"","sources":["../src/FarcasterChannelAdapter.ts"],"names":[],"mappings":"AACA;;GAEG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC;AACrC,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC;AACvC,MAAM,MAAM,uBAAuB,GAAG,cAAc,GAAG,YAAY,GAAG,WAAW,GAAG,cAAc,GAAG,OAAO,CAAC;AAC7G,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAEtC,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,eAAe,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,uBAAuB,CAAC;IAChC,cAAc,CAAC,EAA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C;IAIrF,EAAE,CAAC,OAAO,EAAE,mBAAmB,EAAE,WAAW,CAAC,EAAE,gBAAgB,EAAE,GAAG,MAAM,IAAI;IAKxE,WAAW,CAAC,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAG7F"}
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ // @ts-nocheck
3
+ /**
4
+ * @fileoverview IChannelAdapter implementation for Farcaster.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.FarcasterChannelAdapter = void 0;
8
+ class FarcasterChannelAdapter {
9
+ platform = 'farcaster';
10
+ displayName = 'Farcaster';
11
+ capabilities = [
12
+ 'text', 'embeds', 'reactions', 'threads', 'channels',
13
+ 'content_discovery', 'engagement_metrics',
14
+ ];
15
+ service;
16
+ connectedAt = null;
17
+ handlers = new Set();
18
+ errorMessage = null;
19
+ constructor(service) {
20
+ this.service = service;
21
+ }
22
+ async initialize(_auth) {
23
+ try {
24
+ await this.service.initialize();
25
+ this.connectedAt = new Date().toISOString();
26
+ this.errorMessage = null;
27
+ }
28
+ catch (err) {
29
+ this.errorMessage = err.message;
30
+ throw err;
31
+ }
32
+ }
33
+ async shutdown() {
34
+ await this.service.shutdown();
35
+ this.connectedAt = null;
36
+ }
37
+ getConnectionInfo() {
38
+ if (this.errorMessage) {
39
+ return { status: 'error', errorMessage: this.errorMessage };
40
+ }
41
+ if (!this.service.isRunning) {
42
+ return { status: 'disconnected' };
43
+ }
44
+ return {
45
+ status: 'connected',
46
+ connectedSince: this.connectedAt ?? undefined,
47
+ platformInfo: { platform: 'farcaster' },
48
+ };
49
+ }
50
+ async sendMessage(conversationId, content) {
51
+ const textBlock = content.blocks.find((b) => b.type === 'text');
52
+ const text = textBlock?.text ?? '';
53
+ const embeds = [];
54
+ for (const block of content.blocks) {
55
+ if (block.type === 'image' || block.type === 'link') {
56
+ embeds.push(block.url);
57
+ }
58
+ }
59
+ const channelId = content.platformOptions?.channelId;
60
+ const result = await this.service.publishCast(text, {
61
+ embeds: embeds.length ? embeds : undefined,
62
+ replyTo: content.replyToMessageId,
63
+ channelId,
64
+ });
65
+ return { messageId: result.hash, timestamp: new Date().toISOString() };
66
+ }
67
+ async sendTypingIndicator(_conversationId, _isTyping) {
68
+ // Farcaster doesn't support typing indicators
69
+ }
70
+ on(handler, _eventTypes) {
71
+ this.handlers.add(handler);
72
+ return () => this.handlers.delete(handler);
73
+ }
74
+ async addReaction(_conversationId, messageId, _emoji) {
75
+ await this.service.likeCast(messageId);
76
+ }
77
+ }
78
+ exports.FarcasterChannelAdapter = FarcasterChannelAdapter;
79
+ //# sourceMappingURL=FarcasterChannelAdapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FarcasterChannelAdapter.js","sourceRoot":"","sources":["../src/FarcasterChannelAdapter.ts"],"names":[],"mappings":";AAAA,cAAc;AACd;;GAEG;;;AAmCH,MAAa,uBAAuB;IACzB,QAAQ,GAAoB,WAAW,CAAC;IACxC,WAAW,GAAG,WAAW,CAAC;IAC1B,YAAY,GAAiC;QACpD,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU;QACpD,mBAAmB,EAAE,oBAAoB;KAC1C,CAAC;IAEM,OAAO,CAAmB;IAC1B,WAAW,GAAkB,IAAI,CAAC;IAClC,QAAQ,GAA6B,IAAI,GAAG,EAAE,CAAC;IAC/C,YAAY,GAAkB,IAAI,CAAC;IAE3C,YAAY,OAAyB;QACnC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,KAAwB;QACvC,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;YAChC,IAAI,CAAC,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;YAC5C,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;Q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AM,SAAS,GAAG,OAAO,CAAC,eAAe,EAAE,SAA+B,CAAC;QAE3E,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,EAAE;YAClD,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;YAC1C,OAAO,EAAE,OAAO,CAAC,gBAAgB;YACjC,SAAS;SACV,CAAC,CAAC;QAEH,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC;IACzE,CAAC;IAED,KAAK,CAAC,mBAAmB,CAAC,eAAuB,EAAE,SAAkB;QACnE,8CAA8C;IAChD,CAAC;IAED,EAAE,CAAC,OAA4B,EAAE,WAAgC;QAC/D,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC3B,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,eAAuB,EAAE,SAAiB,EAAE,MAAc;QAC1E,MAAM,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IACzC,CAAC;CACF;AAjFD,0DAiFC"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * @fileoverview Farcaster API service layer.
3
+ *
4
+ * Wraps the Neynar API (v2) for cast publishing, engagement, search,
5
+ * feeds, and user lookup.
6
+ */
7
+ export interface FarcasterConfig {
8
+ signerUuid: string;
9
+ neynarApiKey: string;
10
+ fid?: number;
11
+ }
12
+ export interface CastOptions {
13
+ text: string;
14
+ embeds?: string[];
15
+ replyTo?: string;
16
+ channelId?: string;
17
+ }
18
+ export interface CastResult {
19
+ hash: string;
20
+ authorFid: number;
21
+ text: string;
22
+ timestamp?: string;
23
+ reactions?: {
24
+ likes: number;
25
+ recasts: number;
26
+ };
27
+ }
28
+ export declare class FarcasterService {
29
+ private client;
30
+ private config;
31
+ private running;
32
+ constructor(config: FarcasterConfig);
33
+ initialize(): Promise<void>;
34
+ shutdown(): Promise<void>;
35
+ get isRunning(): boolean;
36
+ publishCast(text: string, options?: {
37
+ embeds?: string[];
38
+ replyTo?: string;
39
+ channelId?: string;
40
+ }): Promise<CastResult>;
41
+ reply(parentHash: string, text: string): Promise<CastResult>;
42
+ likeCast(castHash: string): Promise<void>;
43
+ recast(castHash: string): Promise<void>;
44
+ searchCasts(query: string, limit?: number): Promise<CastResult[]>;
45
+ getFeed(type?: 'following' | 'trending', limit?: number): Promise<CastResult[]>;
46
+ getCast(hash: string): Promise<CastResult | null>;
47
+ deleteCast(hash: string): Promise<void>;
48
+ getUserByFid(fid: number): Promise<{
49
+ fid: number;
50
+ username: string;
51
+ displayName: string;
52
+ } | null>;
53
+ getMe(): Promise<{
54
+ fid: number;
55
+ username: string;
56
+ displayName: string;
57
+ } | null>;
58
+ private requireClient;
59
+ }
60
+ //# sourceMappingURL=FarcasterService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FarcasterService.d.ts","sourceRoot":"","sources":["../src/FarcasterService.ts"],"names":[],"mappings":"AACA;;;;;GAKG;AAQH,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CA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AG,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAkBjG,KAAK,IAAI,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IASrF,OAAO,CAAC,aAAa;CAItB"}
@@ -0,0 +1,197 @@
1
+ "use strict";
2
+ // @ts-nocheck
3
+ /**
4
+ * @fileoverview Farcaster API service layer.
5
+ *
6
+ * Wraps the Neynar API (v2) for cast publishing, engagement, search,
7
+ * feeds, and user lookup.
8
+ */
9
+ var __importDefault = (this && this.__importDefault) || function (mod) {
10
+ return (mod && mod.__esModule) ? mod : { "default": mod };
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.FarcasterService = void 0;
14
+ const axios_1 = __importDefault(require("axios"));
15
+ // ---------------------------------------------------------------------------
16
+ // Service
17
+ // ---------------------------------------------------------------------------
18
+ class FarcasterService {
19
+ client = null;
20
+ config;
21
+ running = false;
22
+ constructor(config) {
23
+ this.config = config;
24
+ }
25
+ async initialize() {
26
+ if (!this.config.neynarApiKey) {
27
+ throw new Error('Farcaster: no Neynar API key provided. Set NEYNAR_API_KEY or provide neynarApiKey in config.');
28
+ }
29
+ if (!this.config.signerUuid) {
30
+ throw new Error('Farcaster: no signer UUID provided. Set FARCASTER_SIGNER_UUID or provide signerUuid in config.');
31
+ }
32
+ this.client = axios_1.default.create({
33
+ baseURL: 'https://api.neynar.com/v2',
34
+ headers: {
35
+ 'api_key': this.config.neynarApiKey,
36
+ 'Content-Type': 'application/json',
37
+ },
38
+ });
39
+ this.running = true;
40
+ }
41
+ async shutdown() {
42
+ this.client = null;
43
+ this.running = false;
44
+ }
45
+ get isRunning() {
46
+ return this.running;
47
+ }
48
+ // -- Casting --
49
+ async publishCast(text, options) {
50
+ const client = this.requireClient();
51
+ const body = {
52
+ signer_uuid: this.config.signerUuid,
53
+ text,
54
+ };
55
+ if (options?.embeds?.length) {
56
+ body.embeds = options.embeds.map((url) => ({ url }));
57
+ }
58
+ if (options?.replyTo) {
59
+ body.parent = options.replyTo;
60
+ }
61
+ if (options?.channelId) {
62
+ body.channel_id = options.channelId;
63
+ }
64
+ const response = await client.post('/farcaster/cast', body);
65
+ const cast = response.data?.cast ?? response.data;
66
+ return {
67
+ hash: cast.hash,
68
+ authorFid: cast.author?.fid ?? this.config.fid ?? 0,
69
+ text: cast.text ?? text,
70
+ timestamp: cast.timestamp,
71
+ };
72
+ }
73
+ async reply(parentHash, text) {
74
+ return this.publishCast(text, { replyTo: parentHash });
75
+ }
76
+ // -- Engagement --
77
+ async likeCast(castHash) {
78
+ const client = this.requireClient();
79
+ await client.post('/farcaster/reaction', {
80
+ signer_uuid: this.config.signerUuid,
81
+ reaction_type: 'like',
82
+ target: castHash,
83
+ });
84
+ }
85
+ async recast(castHash) {
86
+ const client = this.requireClient();
87
+ await client.post('/farcaster/reaction', {
88
+ signer_uuid: this.config.signerUuid,
89
+ reaction_type: 'recast',
90
+ target: castHash,
91
+ });
92
+ }
93
+ // -- Search --
94
+ async searchCasts(query, limit) {
95
+ const client = this.requireClient();
96
+ const response = await client.get('/farcaster/cast/search', {
97
+ params: { q: query, limit: limit ?? 10 },
98
+ });
99
+ const casts = response.data?.result?.casts ?? response.data?.casts ?? [];
100
+ return casts.map((c) => ({
101
+ hash: c.hash,
102
+ authorFid: c.author?.fid ?? 0,
103
+ text: c.text,
104
+ timestamp: c.timestamp,
105
+ reactions: c.reactions ? {
106
+ likes: c.reactions.likes_count ?? c.reactions.likes?.length ?? 0,
107
+ recasts: c.reactions.recasts_count ?? c.reactions.recasts?.length ?? 0,
108
+ } : undefined,
109
+ }));
110
+ }
111
+ // -- Feed --
112
+ async getFeed(type, limit) {
113
+ const client = this.requireClient();
114
+ const response = await client.get('/farcaster/feed', {
115
+ params: { feed_type: type ?? 'following', limit: limit ?? 20 },
116
+ });
117
+ const casts = response.data?.casts ?? [];
118
+ return casts.map((c) => ({
119
+ hash: c.hash,
120
+ authorFid: c.author?.fid ?? 0,
121
+ text: c.text,
122
+ timestamp: c.timestamp,
123
+ reactions: c.reactions ? {
124
+ likes: c.reactions.likes_count ?? c.reactions.likes?.length ?? 0,
125
+ recasts: c.reactions.recasts_count ?? c.reactions.recasts?.length ?? 0,
126
+ } : undefined,
127
+ }));
128
+ }
129
+ // -- Cast Retrieval --
130
+ async getCast(hash) {
131
+ const client = this.requireClient();
132
+ try {
133
+ const response = await client.get('/farcaster/cast', {
134
+ params: { identifier: hash, type: 'hash' },
135
+ });
136
+ const c = response.data?.cast ?? response.data;
137
+ if (!c)
138
+ return null;
139
+ return {
140
+ hash: c.hash,
141
+ authorFid: c.author?.fid ?? 0,
142
+ text: c.text,
143
+ timestamp: c.timestamp,
144
+ reactions: c.reactions ? {
145
+ likes: c.reactions.likes_count ?? c.reactions.likes?.length ?? 0,
146
+ recasts: c.reactions.recasts_count ?? c.reactions.recasts?.length ?? 0,
147
+ } : undefined,
148
+ };
149
+ }
150
+ catch {
151
+ return null;
152
+ }
153
+ }
154
+ async deleteCast(hash) {
155
+ const client = this.requireClient();
156
+ await client.delete('/farcaster/cast', {
157
+ data: {
158
+ signer_uuid: this.config.signerUuid,
159
+ target_hash: hash,
160
+ },
161
+ });
162
+ }
163
+ // -- Users --
164
+ async getUserByFid(fid) {
165
+ const client = this.requireClient();
166
+ try {
167
+ const response = await client.get('/farcaster/user', {
168
+ params: { fid },
169
+ });
170
+ const user = response.data?.user ?? response.data;
171
+ if (!user)
172
+ return null;
173
+ return {
174
+ fid: user.fid,
175
+ username: user.username ?? '',
176
+ displayName: user.display_name ?? user.username ?? '',
177
+ };
178
+ }
179
+ catch {
180
+ return null;
181
+ }
182
+ }
183
+ async getMe() {
184
+ if (this.config.fid) {
185
+ return this.getUserByFid(this.config.fid);
186
+ }
187
+ return null;
188
+ }
189
+ // -- Internal --
190
+ requireClient() {
191
+ if (!this.client)
192
+ throw new Error('Farcaster service not initialized');
193
+ return this.client;
194
+ }
195
+ }
196
+ exports.FarcasterService = FarcasterService;
197
+ //# sourceMappingURL=FarcasterService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FarcasterService.js","sourceRoot":"","sources":["../src/FarcasterService.ts"],"names":[],"mappings":";AAAA,cAAc;AACd;;;;;GAKG;;;;;;AAEH,kDAA6C;AA2B7C,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E,MAAa,gBAAgB;IACnB,MAAM,GAAyB,IAAI,CAAC;IACpC,MAAM,CAAkB;IACxB,OAAO,GAAG,KAAK,CAAC;IAExB,YAAY,MAAuB;QACjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,UAAU;QACd,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CACb,8FAA8F,CAC/F,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;YAC5B,MAAM,IAAI,KAAK,CACb,gGAAgG,CACjG,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,MAAM,GAAG,eAAK,CAAC,MAAM,CAAC;YACzB,OAAO,EAAE,2BAA2B;YACpC,OAAO,EAAE;gBACP,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,YAAY;gBACnC,cAAc,EAAE,kBAAkB;aACnC;SACF,CAAC,CAAC;QAEH,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACtB,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IA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AE,IAAI;aAClB;SACF,CAAC,CAAC;IACL,CAAC;IAED,cAAc;IAEd,KAAK,CAAC,YAAY,CAAC,GAAW;QAC5B,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;QACpC,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,iBAAiB,EAAE;gBACnD,MAAM,EAAE,EAAE,GAAG,EAAE;aAChB,CAAC,CAAC;YACH,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,EAAE,IAAI,IAAI,QAAQ,CAAC,IAAI,CAAC;YAClD,IAAI,CAAC,IAAI;gBAAE,OAAO,IAAI,CAAC;YACvB,OAAO;gBACL,GAAG,EAAE,IAAI,CAAC,GAAG;gBACb,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,EAAE;gBAC7B,WAAW,EAAE,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,QAAQ,IAAI,EAAE;aACtD,CAAC;QACJ,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,KAAK,CAAC,KAAK;QACT,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;YACpB,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC5C,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,iBAAiB;IAET,aAAa;QACnB,IAAI,CAAC,IAAI,CAAC,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;QACvE,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF;AA5MD,4CA4MC"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * @fileoverview Farcaster Channel Extension for AgentOS.
3
+ *
4
+ * Provides a full IChannelAdapter + 6 tools for autonomous Farcaster interaction
5
+ * via the Neynar API.
6
+ *
7
+ * @module @framers/agentos-ext-channel-farcaster
8
+ */
9
+ export interface FarcasterChannelOptions {
10
+ signerUuid?: string;
11
+ neynarApiKey?: string;
12
+ fid?: number;
13
+ secrets?: Record<string, string>;
14
+ }
15
+ export interface ExtensionContext {
16
+ options?: Record<string, unknown>;
17
+ secrets?: Record<string, string>;
18
+ }
19
+ export interface ExtensionPack {
20
+ name: string;
21
+ version: string;
22
+ descriptors: Array<{
23
+ id: string;
24
+ kind: string;
25
+ priority?: number;
26
+ payload: unknown;
27
+ }>;
28
+ onActivate?: () => Promise<void>;
29
+ onDeactivate?: () => Promise<void>;
30
+ }
31
+ export declare function createExtensionPack(context: ExtensionContext): ExtensionPack;
32
+ export { FarcasterService } from './FarcasterService.js';
33
+ export type { FarcasterConfig, CastOptions, CastResult } from './FarcasterService.js';
34
+ export { FarcasterChannelAdapter } from './FarcasterChannelAdapter.js';
35
+ export { FarcasterCastTool } from './tools/cast.js';
36
+ export { FarcasterReplyTool } from './tools/reply.js';
37
+ export { FarcasterLikeTool } from './tools/like.js';
38
+ export { FarcasterRecastTool } from './tools/recast.js';
39
+ export { FarcasterSearchTool } from './tools/search.js';
40
+ export { FarcasterFeedTool } from './tools/feed.js';
41
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAgBH,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AA4BD,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IACtF,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,YAAY,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACpC;AAMD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,gBAAgB,GAAG,aAAa,CAoD5E;AAMD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACtF,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+ // @ts-nocheck
3
+ /**
4
+ * @fileoverview Farcaster Channel Extension for AgentOS.
5
+ *
6
+ * Provides a full IChannelAdapter + 6 tools for autonomous Farcaster interaction
7
+ * via the Neynar API.
8
+ *
9
+ * @module @framers/agentos-ext-channel-farcaster
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.FarcasterFeedTool = exports.FarcasterSearchTool = exports.FarcasterRecastTool = exports.FarcasterLikeTool = exports.FarcasterReplyTool = exports.FarcasterCastTool = exports.FarcasterChannelAdapter = exports.FarcasterService = void 0;
13
+ exports.createExtensionPack = createExtensionPack;
14
+ const FarcasterService_js_1 = require("./FarcasterService.js");
15
+ const FarcasterChannelAdapter_js_1 = require("./FarcasterChannelAdapter.js");
16
+ const cast_js_1 = require("./tools/cast.js");
17
+ const reply_js_1 = require("./tools/reply.js");
18
+ const like_js_1 = require("./tools/like.js");
19
+ const recast_js_1 = require("./tools/recast.js");
20
+ const search_js_1 = require("./tools/search.js");
21
+ const feed_js_1 = require("./tools/feed.js");
22
+ // ---------------------------------------------------------------------------
23
+ // Secret Resolution
24
+ // ---------------------------------------------------------------------------
25
+ function resolveConfig(opts, secrets) {
26
+ return {
27
+ signerUuid: opts.signerUuid ?? secrets['farcaster.signerUuid']
28
+ ?? process.env.FARCASTER_SIGNER_UUID ?? '',
29
+ neynarApiKey: opts.neynarApiKey ?? secrets['farcaster.neynarApiKey']
30
+ ?? process.env.NEYNAR_API_KEY ?? '',
31
+ fid: opts.fid
32
+ ? opts.fid
33
+ : secrets['farcaster.fid']
34
+ ? parseInt(secrets['farcaster.fid'], 10)
35
+ : process.env.FARCASTER_FID
36
+ ? parseInt(process.env.FARCASTER_FID, 10)
37
+ : undefined,
38
+ };
39
+ }
40
+ // ---------------------------------------------------------------------------
41
+ // Factory
42
+ // ---------------------------------------------------------------------------
43
+ function createExtensionPack(context) {
44
+ const opts = (context.options ?? {});
45
+ const secrets = opts.secrets ?? context.secrets ?? {};
46
+ const config = resolveConfig(opts, secrets);
47
+ const service = new FarcasterService_js_1.FarcasterService(config);
48
+ const adapter = new FarcasterChannelAdapter_js_1.FarcasterChannelAdapter(service);
49
+ const castTool = new cast_js_1.FarcasterCastTool(service);
50
+ const replyTool = new reply_js_1.FarcasterReplyTool(service);
51
+ const likeTool = new like_js_1.FarcasterLikeTool(service);
52
+ const recastTool = new recast_js_1.FarcasterRecastTool(service);
53
+ const searchTool = new search_js_1.FarcasterSearchTool(service);
54
+ const feedTool = new feed_js_1.FarcasterFeedTool(service);
55
+ return {
56
+ name: '@framers/agentos-ext-channel-farcaster',
57
+ version: '0.1.0',
58
+ descriptors: [
59
+ { id: 'farcasterCast', kind: 'tool', priority: 50, payload: castTool },
60
+ { id: 'farcasterReply', kind: 'tool', priority: 50, payload: replyTool },
61
+ { id: 'farcasterLike', kind: 'tool', priority: 50, payload: likeTool },
62
+ { id: 'farcasterRecast', kind: 'tool', priority: 50, payload: recastTool },
63
+ { id: 'farcasterSearch', kind: 'tool', priority: 50, payload: searchTool },
64
+ { id: 'farcasterFeed', kind: 'tool', priority: 50, payload: feedTool },
65
+ { id: 'farcasterChannel', kind: 'messaging-channel', priority: 50, payload: adapter },
66
+ ],
67
+ onActivate: async () => {
68
+ if (!config.neynarApiKey) {
69
+ try {
70
+ const { FileTokenStore } = await import('@framers/agentos/auth');
71
+ const tokens = await new FileTokenStore().load('farcaster');
72
+ if (tokens?.accessToken) {
73
+ const metadata = tokens.metadata ?? {};
74
+ config.neynarApiKey = tokens.accessToken;
75
+ config.signerUuid = config.signerUuid || metadata.signerUuid || '';
76
+ config.fid = config.fid
77
+ ?? (metadata.fid ? parseInt(metadata.fid, 10) : undefined);
78
+ }
79
+ }
80
+ catch { /* FileTokenStore not available — ignore */ }
81
+ }
82
+ await service.initialize();
83
+ const credential = config.neynarApiKey || '';
84
+ if (credential) {
85
+ await adapter.initialize({ platform: 'farcaster', credential });
86
+ }
87
+ },
88
+ onDeactivate: async () => {
89
+ await adapter.shutdown();
90
+ },
91
+ };
92
+ }
93
+ // ---------------------------------------------------------------------------
94
+ // Public exports
95
+ // ---------------------------------------------------------------------------
96
+ var FarcasterService_js_2 = require("./FarcasterService.js");
97
+ Object.defineProperty(exports, "FarcasterService", { enumerable: true, get: function () { return FarcasterService_js_2.FarcasterService; } });
98
+ var FarcasterChannelAdapter_js_2 = require("./FarcasterChannelAdapter.js");
99
+ Object.defineProperty(exports, "FarcasterChannelAdapter", { enumerable: true, get: function () { return FarcasterChannelAdapter_js_2.FarcasterChannelAdapter; } });
100
+ var cast_js_2 = require("./tools/cast.js");
101
+ Object.defineProperty(exports, "FarcasterCastTool", { enumerable: true, get: function () { return cast_js_2.FarcasterCastTool; } });
102
+ var reply_js_2 = require("./tools/reply.js");
103
+ Object.defineProperty(exports, "FarcasterReplyTool", { enumerable: true, get: function () { return reply_js_2.FarcasterReplyTool; } });
104
+ var like_js_2 = require("./tools/like.js");
105
+ Object.defineProperty(exports, "FarcasterLikeTool", { enumerable: true, get: function () { return like_js_2.FarcasterLikeTool; } });
106
+ var recast_js_2 = require("./tools/recast.js");
107
+ Object.defineProperty(exports, "FarcasterRecastTool", { enumerable: true, get: function () { return recast_js_2.FarcasterRecastTool; } });
108
+ var search_js_2 = require("./tools/search.js");
109
+ Object.defineProperty(exports, "FarcasterSearchTool", { enumerable: true, get: function () { return search_js_2.FarcasterSearchTool; } });
110
+ var feed_js_2 = require("./tools/feed.js");
111
+ Object.defineProperty(exports, "FarcasterFeedTool", { enumerable: true, get: function () { return feed_js_2.FarcasterFeedTool; } });
112
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,cAAc;AACd;;;;;;;GAOG;;;AAkEH,kDAoDC;AApHD,+DAAyD;AAEzD,6EAAuE;AACvE,6CAAoD;AACpD,+CAAsD;AACtD,6CAAoD;AACpD,iDAAwD;AACxD,iDAAwD;AACxD,6CAAoD;AAapD,8EAA8E;AAC9E,oBAAoB;AACpB,8EAA8E;AAE9E,SAAS,aAAa,CAAC,IAA6B,EAAE,OAA+B;IACnF,OAAO;QACL,UAAU,EACR,IAAI,CAAC,UAAU,IAAI,OAAO,CAAC,sBAAsB,CAAC;eAC/C,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,EAAE;QAC5C,YAAY,EACV,IAAI,CAA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0 +1,43 @@
1
+ import type { FarcasterService } from '../FarcasterService.js';
2
+ export declare class FarcasterCastTool {
3
+ private service;
4
+ readonly id = "farcasterCast";
5
+ readonly name = "farcasterCast";
6
+ readonly displayName = "Publish Cast";
7
+ readonly description = "Publish a cast on Farcaster with optional embeds and channel targeting.";
8
+ readonly category = "social";
9
+ readonly version = "0.1.0";
10
+ readonly hasSideEffects = true;
11
+ readonly inputSchema: {
12
+ type: "object";
13
+ properties: {
14
+ text: {
15
+ type: string;
16
+ description: string;
17
+ };
18
+ embeds: {
19
+ type: string;
20
+ items: {
21
+ type: string;
22
+ };
23
+ description: string;
24
+ };
25
+ channelId: {
26
+ type: string;
27
+ description: string;
28
+ };
29
+ };
30
+ required: string[];
31
+ };
32
+ constructor(service: FarcasterService);
33
+ execute(args: {
34
+ text: string;
35
+ embeds?: string[];
36
+ channelId?: string;
37
+ }): Promise<{
38
+ success: boolean;
39
+ data?: any;
40
+ error?: string;
41
+ }>;
42
+ }
43
+ //# sourceMappingURL=cast.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cast.d.ts","sourceRoot":"","sources":["../../src/tools/cast.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,qBAAa,iBAAiB;IAmBhB,OAAO,CAAC,OAAO;IAlB3B,QAAQ,CAAC,EAAE,mBAAmB;IAC9B,QAAQ,CAAC,IAAI,mBAAmB;IAChC,QAAQ,CAAC,WAAW,kBAAkB;IACtC,QAAQ,CAAC,WAAW,6EAA6E;IACjG,QAAQ,CAAC,QAAQ,YAAY;IAC7B,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,cAAc,QAAQ;IAE/B,QAAQ,CAAC,WAAW;;;;;;;;;;;;;;;;;;;;MAQlB;gBAEkB,OAAO,EAAE,gBAAgB;IAEvC,OAAO,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAWxI"}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FarcasterCastTool = void 0;
4
+ class FarcasterCastTool {
5
+ service;
6
+ id = 'farcasterCast';
7
+ name = 'farcasterCast';
8
+ displayName = 'Publish Cast';
9
+ description = 'Publish a cast on Farcaster with optional embeds and channel targeting.';
10
+ category = 'social';
11
+ version = '0.1.0';
12
+ hasSideEffects = true;
13
+ inputSchema = {
14
+ type: 'object',
15
+ properties: {
16
+ text: { type: 'string', description: 'Cast text content' },
17
+ embeds: { type: 'array', items: { type: 'string' }, description: 'URLs to embed in the cast' },
18
+ channelId: { type: 'string', description: 'Farcaster channel ID to post in (e.g. "ethereum")' },
19
+ },
20
+ required: ['text'],
21
+ };
22
+ constructor(service) {
23
+ this.service = service;
24
+ }
25
+ async execute(args) {
26
+ try {
27
+ const result = await this.service.publishCast(args.text, {
28
+ embeds: args.embeds,
29
+ channelId: args.channelId,
30
+ });
31
+ return { success: true, data: result };
32
+ }
33
+ catch (err) {
34
+ return { success: false, error: err.message };
35
+ }
36
+ }
37
+ }
38
+ exports.FarcasterCastTool = FarcasterCastTool;
39
+ //# sourceMappingURL=cast.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cast.js","sourceRoot":"","sources":["../../src/tools/cast.ts"],"names":[],"mappings":";;;AAGA,MAAa,iBAAiB;IAmBR;IAlBX,EAAE,GAAG,eAAe,CAAC;IACrB,IAAI,GAAG,eAAe,CAAC;IACvB,WAAW,GAAG,cAAc,CAAC;IAC7B,WAAW,GAAG,yEAAyE,CAAC;IACxF,QAAQ,GAAG,QAAQ,CAAC;IACpB,OAAO,GAAG,OAAO,CAAC;IAClB,cAAc,GAAG,IAAI,CAAC;IAEtB,WAAW,GAAG;QACrB,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,mBAAmB,EAAE;YAC1D,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,WAAW,EAAE,2BAA2B,EAAE;YAC9F,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,mDAAmD,EAAE;SAChG;QACD,QAAQ,EAAE,CAAC,MAAM,CAAC;KACnB,CAAC;IAEF,YAAoB,OAAyB;QAAzB,YAAO,GAAP,OAAO,CAAkB;IAAG,CAAC;IAEjD,KAAK,CAAC,OAAO,CAAC,IAA6D;QACzE,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE;gBACvD,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,SAAS,EAAE,IAAI,CAAC,SAAS;aAC1B,CAAC,CAAC;YACH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QACzC,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;QAChD,CAAC;IACH,CAAC;CACF;AAhCD,8CAgCC"}
@@ -0,0 +1,36 @@
1
+ import type { FarcasterService } from '../FarcasterService.js';
2
+ export declare class FarcasterFeedTool {
3
+ private service;
4
+ readonly id = "farcasterFeed";
5
+ readonly name = "farcasterFeed";
6
+ readonly displayName = "Get Feed";
7
+ readonly description = "Get Farcaster feed \u2014 following or trending casts.";
8
+ readonly category = "social";
9
+ readonly version = "0.1.0";
10
+ readonly hasSideEffects = false;
11
+ readonly inputSchema: {
12
+ type: "object";
13
+ properties: {
14
+ type: {
15
+ type: string;
16
+ enum: string[];
17
+ description: string;
18
+ };
19
+ limit: {
20
+ type: string;
21
+ description: string;
22
+ };
23
+ };
24
+ required: never[];
25
+ };
26
+ constructor(service: FarcasterService);
27
+ execute(args: {
28
+ type?: 'following' | 'trending';
29
+ limit?: number;
30
+ }): Promise<{
31
+ success: boolean;
32
+ data?: any;
33
+ error?: string;
34
+ }>;
35
+ }
36
+ //# sourceMappingURL=feed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feed.d.ts","sourceRoot":"","sources":["../../src/tools/feed.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,qBAAa,iBAAiB;IAkBhB,OAAO,CAAC,OAAO;IAjB3B,QAAQ,CAAC,EAAE,mBAAmB;IAC9B,QAAQ,CAAC,IAAI,mBAAmB;IAChC,QAAQ,CAAC,WAAW,cAAc;IAClC,QAAQ,CAAC,WAAW,4DAAuD;IAC3E,QAAQ,CAAC,QAAQ,YAAY;IAC7B,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,cAAc,SAAS;IAEhC,QAAQ,CAAC,WAAW;;;;;;;;;;;;;;MAOlB;gBAEkB,OAAO,EAAE,gBAAgB;IAEvC,OAAO,CAAC,IAAI,EAAE;QAAE,IAAI,CAAC,EAAE,WAAW,GAAG,UAAU,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAQpI"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FarcasterFeedTool = void 0;
4
+ class FarcasterFeedTool {
5
+ service;
6
+ id = 'farcasterFeed';
7
+ name = 'farcasterFeed';
8
+ displayName = 'Get Feed';
9
+ description = 'Get Farcaster feed — following or trending casts.';
10
+ category = 'social';
11
+ version = '0.1.0';
12
+ hasSideEffects = false;
13
+ inputSchema = {
14
+ type: 'object',
15
+ properties: {
16
+ type: { type: 'string', enum: ['following', 'trending'], description: 'Feed type (default "following")' },
17
+ limit: { type: 'number', description: 'Max casts to return (default 20)' },
18
+ },
19
+ required: [],
20
+ };
21
+ constructor(service) {
22
+ this.service = service;
23
+ }
24
+ async execute(args) {
25
+ try {
26
+ const results = await this.service.getFeed(args.type, args.limit);
27
+ return { success: true, data: results };
28
+ }
29
+ catch (err) {
30
+ return { success: false, error: err.message };
31
+ }
32
+ }
33
+ }
34
+ exports.FarcasterFeedTool = FarcasterFeedTool;
35
+ //# sourceMappingURL=feed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feed.js","sourceRoot":"","sources":["../../src/tools/feed.ts"],"names":[],"mappings":";;;AAGA,MAAa,iBAAiB;IAkBR;IAjBX,EAAE,GAAG,eAAe,CAAC;IACrB,IAAI,GAAG,eAAe,CAAC;IACvB,WAAW,GAAG,UAAU,CAAC;IACzB,WAAW,GAAG,mDAAmD,CAAC;IAClE,QAAQ,GAAG,QAAQ,CAAC;IACpB,OAAO,GAAG,OAAO,CAAC;IAClB,cAAc,GAAG,KAAK,CAAC;IAEvB,WAAW,GAAG;QACrB,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,UAAU,CAAC,EAAE,WAAW,EAAE,iCAAiC,EAAE;YACzG,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kCAAkC,EAAE;SAC3E;QACD,QAAQ,EAAE,EAAE;KACb,CAAC;IAEF,YAAoB,OAAyB;QAAzB,YAAO,GAAP,OAAO,CAAkB;IAAG,CAAC;IAEjD,KAAK,CAAC,OAAO,CAAC,IAAyD;QACrE,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;YAClE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;QAC1C,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;QAChD,CAAC;IACH,CAAC;CACF;AA5BD,8CA4BC"}
@@ -0,0 +1,29 @@
1
+ import type { FarcasterService } from '../FarcasterService.js';
2
+ export declare class FarcasterLikeTool {
3
+ private service;
4
+ readonly id = "farcasterLike";
5
+ readonly name = "farcasterLike";
6
+ readonly displayName = "Like Cast";
7
+ readonly description = "Like a cast on Farcaster.";
8
+ readonly category = "social";
9
+ readonly version = "0.1.0";
10
+ readonly hasSideEffects = true;
11
+ readonly inputSchema: {
12
+ type: "object";
13
+ properties: {
14
+ castHash: {
15
+ type: string;
16
+ description: string;
17
+ };
18
+ };
19
+ required: string[];
20
+ };
21
+ constructor(service: FarcasterService);
22
+ execute(args: {
23
+ castHash: string;
24
+ }): Promise<{
25
+ success: boolean;
26
+ error?: string;
27
+ }>;
28
+ }
29
+ //# sourceMappingURL=like.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"like.d.ts","sourceRoot":"","sources":["../../src/tools/like.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,qBAAa,iBAAiB;IAiBhB,OAAO,CAAC,OAAO;IAhB3B,QAAQ,CAAC,EAAE,mBAAmB;IAC9B,QAAQ,CAAC,IAAI,mBAAmB;IAChC,QAAQ,CAAC,WAAW,eAAe;IACnC,QAAQ,CAAC,WAAW,+BAA+B;IACnD,QAAQ,CAAC,QAAQ,YAAY;IAC7B,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,cAAc,QAAQ;IAE/B,QAAQ,CAAC,WAAW;;;;;;;;;MAMlB;gBAEkB,OAAO,EAAE,gBAAgB;IAEvC,OAAO,CAAC,IAAI,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAQzF"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FarcasterLikeTool = void 0;
4
+ class FarcasterLikeTool {
5
+ service;
6
+ id = 'farcasterLike';
7
+ name = 'farcasterLike';
8
+ displayName = 'Like Cast';
9
+ description = 'Like a cast on Farcaster.';
10
+ category = 'social';
11
+ version = '0.1.0';
12
+ hasSideEffects = true;
13
+ inputSchema = {
14
+ type: 'object',
15
+ properties: {
16
+ castHash: { type: 'string', description: 'Hash of the cast to like' },
17
+ },
18
+ required: ['castHash'],
19
+ };
20
+ constructor(service) {
21
+ this.service = service;
22
+ }
23
+ async execute(args) {
24
+ try {
25
+ await this.service.likeCast(args.castHash);
26
+ return { success: true };
27
+ }
28
+ catch (err) {
29
+ return { success: false, error: err.message };
30
+ }
31
+ }
32
+ }
33
+ exports.FarcasterLikeTool = FarcasterLikeTool;
34
+ //# sourceMappingURL=like.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"like.js","sourceRoot":"","sources":["../../src/tools/like.ts"],"names":[],"mappings":";;;AAGA,MAAa,iBAAiB;IAiBR;IAhBX,EAAE,GAAG,eAAe,CAAC;IACrB,IAAI,GAAG,eAAe,CAAC;IACvB,WAAW,GAAG,WAAW,CAAC;IAC1B,WAAW,GAAG,2BAA2B,CAAC;IAC1C,QAAQ,GAAG,QAAQ,CAAC;IACpB,OAAO,GAAG,OAAO,CAAC;IAClB,cAAc,GAAG,IAAI,CAAC;IAEtB,WAAW,GAAG;QACrB,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,0BAA0B,EAAE;SACtE;QACD,QAAQ,EAAE,CAAC,UAAU,CAAC;KACvB,CAAC;IAEF,YAAoB,OAAyB;QAAzB,YAAO,GAAP,OAAO,CAAkB;IAAG,CAAC;IAEjD,KAAK,CAAC,OAAO,CAAC,IAA0B;QACtC,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC3C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAC3B,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;QAChD,CAAC;IACH,CAAC;CACF;AA3BD,8CA2BC"}
@@ -0,0 +1,29 @@
1
+ import type { FarcasterService } from '../FarcasterService.js';
2
+ export declare class FarcasterRecastTool {
3
+ private service;
4
+ readonly id = "farcasterRecast";
5
+ readonly name = "farcasterRecast";
6
+ readonly displayName = "Recast";
7
+ readonly description = "Recast (share) a cast on Farcaster.";
8
+ readonly category = "social";
9
+ readonly version = "0.1.0";
10
+ readonly hasSideEffects = true;
11
+ readonly inputSchema: {
12
+ type: "object";
13
+ properties: {
14
+ castHash: {
15
+ type: string;
16
+ description: string;
17
+ };
18
+ };
19
+ required: string[];
20
+ };
21
+ constructor(service: FarcasterService);
22
+ execute(args: {
23
+ castHash: string;
24
+ }): Promise<{
25
+ success: boolean;
26
+ error?: string;
27
+ }>;
28
+ }
29
+ //# sourceMappingURL=recast.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recast.d.ts","sourceRoot":"","sources":["../../src/tools/recast.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,qBAAa,mBAAmB;IAiBlB,OAAO,CAAC,OAAO;IAhB3B,QAAQ,CAAC,EAAE,qBAAqB;IAChC,QAAQ,CAAC,IAAI,qBAAqB;IAClC,QAAQ,CAAC,WAAW,YAAY;IAChC,QAAQ,CAAC,WAAW,yCAAyC;IAC7D,QAAQ,CAAC,QAAQ,YAAY;IAC7B,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,cAAc,QAAQ;IAE/B,QAAQ,CAAC,WAAW;;;;;;;;;MAMlB;gBAEkB,OAAO,EAAE,gBAAgB;IAEvC,OAAO,CAAC,IAAI,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAQzF"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FarcasterRecastTool = void 0;
4
+ class FarcasterRecastTool {
5
+ service;
6
+ id = 'farcasterRecast';
7
+ name = 'farcasterRecast';
8
+ displayName = 'Recast';
9
+ description = 'Recast (share) a cast on Farcaster.';
10
+ category = 'social';
11
+ version = '0.1.0';
12
+ hasSideEffects = true;
13
+ inputSchema = {
14
+ type: 'object',
15
+ properties: {
16
+ castHash: { type: 'string', description: 'Hash of the cast to recast' },
17
+ },
18
+ required: ['castHash'],
19
+ };
20
+ constructor(service) {
21
+ this.service = service;
22
+ }
23
+ async execute(args) {
24
+ try {
25
+ await this.service.recast(args.castHash);
26
+ return { success: true };
27
+ }
28
+ catch (err) {
29
+ return { success: false, error: err.message };
30
+ }
31
+ }
32
+ }
33
+ exports.FarcasterRecastTool = FarcasterRecastTool;
34
+ //# sourceMappingURL=recast.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recast.js","sourceRoot":"","sources":["../../src/tools/recast.ts"],"names":[],"mappings":";;;AAGA,MAAa,mBAAmB;IAiBV;IAhBX,EAAE,GAAG,iBAAiB,CAAC;IACvB,IAAI,GAAG,iBAAiB,CAAC;IACzB,WAAW,GAAG,QAAQ,CAAC;IACvB,WAAW,GAAG,qCAAqC,CAAC;IACpD,QAAQ,GAAG,QAAQ,CAAC;IACpB,OAAO,GAAG,OAAO,CAAC;IAClB,cAAc,GAAG,IAAI,CAAC;IAEtB,WAAW,GAAG;QACrB,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,4BAA4B,EAAE;SACxE;QACD,QAAQ,EAAE,CAAC,UAAU,CAAC;KACvB,CAAC;IAEF,YAAoB,OAAyB;QAAzB,YAAO,GAAP,OAAO,CAAkB;IAAG,CAAC;IAEjD,KAAK,CAAC,OAAO,CAAC,IAA0B;QACtC,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAC3B,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;QAChD,CAAC;IACH,CAAC;CACF;AA3BD,kDA2BC"}
@@ -0,0 +1,35 @@
1
+ import type { FarcasterService } from '../FarcasterService.js';
2
+ export declare class FarcasterReplyTool {
3
+ private service;
4
+ readonly id = "farcasterReply";
5
+ readonly name = "farcasterReply";
6
+ readonly displayName = "Reply to Cast";
7
+ readonly description = "Reply to an existing cast on Farcaster.";
8
+ readonly category = "social";
9
+ readonly version = "0.1.0";
10
+ readonly hasSideEffects = true;
11
+ readonly inputSchema: {
12
+ type: "object";
13
+ properties: {
14
+ parentHash: {
15
+ type: string;
16
+ description: string;
17
+ };
18
+ text: {
19
+ type: string;
20
+ description: string;
21
+ };
22
+ };
23
+ required: string[];
24
+ };
25
+ constructor(service: FarcasterService);
26
+ execute(args: {
27
+ parentHash: string;
28
+ text: string;
29
+ }): Promise<{
30
+ success: boolean;
31
+ data?: any;
32
+ error?: string;
33
+ }>;
34
+ }
35
+ //# sourceMappingURL=reply.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reply.d.ts","sourceRoot":"","sources":["../../src/tools/reply.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,qBAAa,kBAAkB;IAkBjB,OAAO,CAAC,OAAO;IAjB3B,QAAQ,CAAC,EAAE,oBAAoB;IAC/B,QAAQ,CAAC,IAAI,oBAAoB;IACjC,QAAQ,CAAC,WAAW,mBAAmB;IACvC,QAAQ,CAAC,WAAW,6CAA6C;IACjE,QAAQ,CAAC,QAAQ,YAAY;IAC7B,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,cAAc,QAAQ;IAE/B,QAAQ,CAAC,WAAW;;;;;;;;;;;;;MAOlB;gBAEkB,OAAO,EAAE,gBAAgB;IAEvC,OAAO,CAAC,IAAI,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAQrH"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FarcasterReplyTool = void 0;
4
+ class FarcasterReplyTool {
5
+ service;
6
+ id = 'farcasterReply';
7
+ name = 'farcasterReply';
8
+ displayName = 'Reply to Cast';
9
+ description = 'Reply to an existing cast on Farcaster.';
10
+ category = 'social';
11
+ version = '0.1.0';
12
+ hasSideEffects = true;
13
+ inputSchema = {
14
+ type: 'object',
15
+ properties: {
16
+ parentHash: { type: 'string', description: 'Hash of the cast to reply to' },
17
+ text: { type: 'string', description: 'Reply text' },
18
+ },
19
+ required: ['parentHash', 'text'],
20
+ };
21
+ constructor(service) {
22
+ this.service = service;
23
+ }
24
+ async execute(args) {
25
+ try {
26
+ const result = await this.service.reply(args.parentHash, args.text);
27
+ return { success: true, data: result };
28
+ }
29
+ catch (err) {
30
+ return { success: false, error: err.message };
31
+ }
32
+ }
33
+ }
34
+ exports.FarcasterReplyTool = FarcasterReplyTool;
35
+ //# sourceMappingURL=reply.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reply.js","sourceRoot":"","sources":["../../src/tools/reply.ts"],"names":[],"mappings":";;;AAGA,MAAa,kBAAkB;IAkBT;IAjBX,EAAE,GAAG,gBAAgB,CAAC;IACtB,IAAI,GAAG,gBAAgB,CAAC;IACxB,WAAW,GAAG,eAAe,CAAC;IAC9B,WAAW,GAAG,yCAAyC,CAAC;IACxD,QAAQ,GAAG,QAAQ,CAAC;IACpB,OAAO,GAAG,OAAO,CAAC;IAClB,cAAc,GAAG,IAAI,CAAC;IAEtB,WAAW,GAAG;QACrB,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,8BAA8B,EAAE;YAC3E,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE;SACpD;QACD,QAAQ,EAAE,CAAC,YAAY,EAAE,MAAM,CAAC;KACjC,CAAC;IAEF,YAAoB,OAAyB;QAAzB,YAAO,GAAP,OAAO,CAAkB;IAAG,CAAC;IAEjD,KAAK,CAAC,OAAO,CAAC,IAA0C;QACtD,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;YACpE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QACzC,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;QAChD,CAAC;IACH,CAAC;CACF;AA5BD,gDA4BC"}
@@ -0,0 +1,35 @@
1
+ import type { FarcasterService } from '../FarcasterService.js';
2
+ export declare class FarcasterSearchTool {
3
+ private service;
4
+ readonly id = "farcasterSearch";
5
+ readonly name = "farcasterSearch";
6
+ readonly displayName = "Search Casts";
7
+ readonly description = "Search Farcaster for casts matching a query.";
8
+ readonly category = "social";
9
+ readonly version = "0.1.0";
10
+ readonly hasSideEffects = false;
11
+ readonly inputSchema: {
12
+ type: "object";
13
+ properties: {
14
+ query: {
15
+ type: string;
16
+ description: string;
17
+ };
18
+ limit: {
19
+ type: string;
20
+ description: string;
21
+ };
22
+ };
23
+ required: string[];
24
+ };
25
+ constructor(service: FarcasterService);
26
+ execute(args: {
27
+ query: string;
28
+ limit?: number;
29
+ }): Promise<{
30
+ success: boolean;
31
+ data?: any;
32
+ error?: string;
33
+ }>;
34
+ }
35
+ //# sourceMappingURL=search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,qBAAa,mBAAmB;IAkBlB,OAAO,CAAC,OAAO;IAjB3B,QAAQ,CAAC,EAAE,qBAAqB;IAChC,QAAQ,CAAC,IAAI,qBAAqB;IAClC,QAAQ,CAAC,WAAW,kBAAkB;IACtC,QAAQ,CAAC,WAAW,kDAAkD;IACtE,QAAQ,CAAC,QAAQ,YAAY;IAC7B,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,cAAc,SAAS;IAEhC,QAAQ,CAAC,WAAW;;;;;;;;;;;;;MAOlB;gBAEkB,OAAO,EAAE,gBAAgB;IAEvC,OAAO,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAQlH"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FarcasterSearchTool = void 0;
4
+ class FarcasterSearchTool {
5
+ service;
6
+ id = 'farcasterSearch';
7
+ name = 'farcasterSearch';
8
+ displayName = 'Search Casts';
9
+ description = 'Search Farcaster for casts matching a query.';
10
+ category = 'social';
11
+ version = '0.1.0';
12
+ hasSideEffects = false;
13
+ inputSchema = {
14
+ type: 'object',
15
+ properties: {
16
+ query: { type: 'string', description: 'Search query' },
17
+ limit: { type: 'number', description: 'Max results to return (default 10)' },
18
+ },
19
+ required: ['query'],
20
+ };
21
+ constructor(service) {
22
+ this.service = service;
23
+ }
24
+ async execute(args) {
25
+ try {
26
+ const results = await this.service.searchCasts(args.query, args.limit);
27
+ return { success: true, data: results };
28
+ }
29
+ catch (err) {
30
+ return { success: false, error: err.message };
31
+ }
32
+ }
33
+ }
34
+ exports.FarcasterSearchTool = FarcasterSearchTool;
35
+ //# sourceMappingURL=search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":";;;AAGA,MAAa,mBAAmB;IAkBV;IAjBX,EAAE,GAAG,iBAAiB,CAAC;IACvB,IAAI,GAAG,iBAAiB,CAAC;IACzB,WAAW,GAAG,cAAc,CAAC;IAC7B,WAAW,GAAG,8CAA8C,CAAC;IAC7D,QAAQ,GAAG,QAAQ,CAAC;IACpB,OAAO,GAAG,OAAO,CAAC;IAClB,cAAc,GAAG,KAAK,CAAC;IAEvB,WAAW,GAAG;QACrB,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE;YACtD,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oCAAoC,EAAE;SAC7E;QACD,QAAQ,EAAE,CAAC,OAAO,CAAC;KACpB,CAAC;IAEF,YAAoB,OAAyB;QAAzB,YAAO,GAAP,OAAO,CAAkB;IAAG,CAAC;IAEjD,KAAK,CAAC,OAAO,CAAC,IAAuC;QACnD,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;YACvE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;QAC1C,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;QAChD,CAAC;IACH,CAAC;CACF;AA5BD,kDA4BC"}
package/manifest.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "$schema": "https://agentos.sh/schemas/extension-manifest-v1.json",
3
+ "id": "com.framers.channels.farcaster",
4
+ "name": "Farcaster Channel Extension",
5
+ "version": "0.1.0",
6
+ "description": "Bidirectional Farcaster integration — publish casts, reply, like, recast, search, and browse feeds via Neynar API.",
7
+ "categories": ["channel", "social"],
8
+ "platforms": ["farcaster"],
9
+ "sdk": "neynar-api",
10
+ "extensions": [
11
+ { "kind": "tool", "id": "farcasterCast", "displayName": "Publish Cast" },
12
+ { "kind": "tool", "id": "farcasterReply", "displayName": "Reply to Cast" },
13
+ { "kind": "tool", "id": "farcasterLike", "displayName": "Like Cast" },
14
+ { "kind": "tool", "id": "farcasterRecast", "displayName": "Recast" },
15
+ { "kind": "tool", "id": "farcasterSearch", "displayName": "Search Casts" },
16
+ { "kind": "tool", "id": "farcasterFeed", "displayName": "Get Feed" },
17
+ { "kind": "messaging-channel", "id": "farcasterChannel", "displayName": "Farcaster Channel Adapter" }
18
+ ],
19
+ "requiredSecrets": ["farcaster.neynarApiKey", "farcaster.signerUuid"],
20
+ "optionalSecrets": ["farcaster.fid"],
21
+ "features": [
22
+ "Publish casts with text, embeds, and channel targeting",
23
+ "Reply to existing casts",
24
+ "Like and recast for engagement",
25
+ "Search casts by query",
26
+ "Browse following and trending feeds",
27
+ "Retrieve cast details and user profiles"
28
+ ]
29
+ }
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@framers/agentos-ext-channel-farcaster",
3
+ "version": "0.1.0",
4
+ "description": "Farcaster channel adapter for AgentOS — publish casts, reply, like, recast, search, and browse feeds via Neynar API.",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "dist",
9
+ "manifest.json"
10
+ ],
11
+ "peerDependencies": {
12
+ "@framers/agentos": "^0.5.2"
13
+ },
14
+ "dependencies": {
15
+ "axios": "^1.7.0"
16
+ },
17
+ "devDependencies": {
18
+ "@framers/agentos": "^0.6.6",
19
+ "@types/node": "^20.0.0",
20
+ "typescript": "^5.0.0",
21
+ "vitest": "^1.0.0"
22
+ },
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "https://github.com/framersai/agentos-extensions",
26
+ "directory": "registry/curated/channels/farcaster"
27
+ },
28
+ "scripts": {
29
+ "build": "tsc",
30
+ "dev": "tsc --watch",
31
+ "test": "vitest run",
32
+ "test:watch": "vitest watch",
33
+ "clean": "rm -rf dist"
34
+ }
35
+ }