@framers/agentos-ext-channel-reddit 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 (47) hide show
  1. package/LICENSE +98 -0
  2. package/dist/RedditChannelAdapter.d.ts +30 -0
  3. package/dist/RedditChannelAdapter.d.ts.map +1 -0
  4. package/dist/RedditChannelAdapter.js +195 -0
  5. package/dist/RedditChannelAdapter.js.map +1 -0
  6. package/dist/RedditService.d.ts +135 -0
  7. package/dist/RedditService.d.ts.map +1 -0
  8. package/dist/RedditService.js +420 -0
  9. package/dist/RedditService.js.map +1 -0
  10. package/dist/index.d.ts +33 -0
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +110 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/tools/analytics.d.ts +96 -0
  15. package/dist/tools/analytics.d.ts.map +1 -0
  16. package/dist/tools/analytics.js +81 -0
  17. package/dist/tools/analytics.js.map +1 -0
  18. package/dist/tools/comment.d.ts +56 -0
  19. package/dist/tools/comment.d.ts.map +1 -0
  20. package/dist/tools/comment.js +72 -0
  21. package/dist/tools/comment.js.map +1 -0
  22. package/dist/tools/inbox.d.ts +103 -0
  23. package/dist/tools/inbox.d.ts.map +1 -0
  24. package/dist/tools/inbox.js +137 -0
  25. package/dist/tools/inbox.js.map +1 -0
  26. package/dist/tools/search.d.ts +106 -0
  27. package/dist/tools/search.d.ts.map +1 -0
  28. package/dist/tools/search.js +113 -0
  29. package/dist/tools/search.js.map +1 -0
  30. package/dist/tools/submitPost.d.ts +99 -0
  31. package/dist/tools/submitPost.d.ts.map +1 -0
  32. package/dist/tools/submitPost.js +109 -0
  33. package/dist/tools/submitPost.js.map +1 -0
  34. package/dist/tools/subscribe.d.ts +57 -0
  35. package/dist/tools/subscribe.d.ts.map +1 -0
  36. package/dist/tools/subscribe.js +73 -0
  37. package/dist/tools/subscribe.js.map +1 -0
  38. package/dist/tools/trending.d.ts +98 -0
  39. package/dist/tools/trending.d.ts.map +1 -0
  40. package/dist/tools/trending.js +107 -0
  41. package/dist/tools/trending.js.map +1 -0
  42. package/dist/tools/vote.d.ts +57 -0
  43. package/dist/tools/vote.d.ts.map +1 -0
  44. package/dist/tools/vote.js +73 -0
  45. package/dist/tools/vote.js.map +1 -0
  46. package/manifest.json +73 -0
  47. package/package.json +51 -0
@@ -0,0 +1,98 @@
1
+ /**
2
+ * @fileoverview ITool for fetching trending posts and subreddits via the Reddit channel adapter.
3
+ */
4
+ import type { ITool, ToolExecutionContext, ToolExecutionResult } from '@framers/agentos';
5
+ import type { RedditService } from '../RedditService';
6
+ export declare class RedditTrendingTool implements ITool {
7
+ private readonly service;
8
+ readonly id = "redditTrending";
9
+ readonly name = "reddit.trending";
10
+ readonly displayName = "Reddit Trending";
11
+ readonly description = "Get trending posts from Reddit front page or a specific subreddit. Supports hot, top, rising, new, and controversial sorting.";
12
+ readonly category = "social";
13
+ readonly version = "0.1.0";
14
+ readonly hasSideEffects = false;
15
+ readonly inputSchema: {
16
+ type: "object";
17
+ required: readonly [];
18
+ properties: {
19
+ subreddit: {
20
+ type: string;
21
+ description: string;
22
+ };
23
+ sort: {
24
+ type: string;
25
+ enum: string[];
26
+ description: string;
27
+ };
28
+ time: {
29
+ type: string;
30
+ enum: string[];
31
+ description: string;
32
+ };
33
+ limit: {
34
+ type: string;
35
+ description: string;
36
+ minimum: number;
37
+ maximum: number;
38
+ };
39
+ };
40
+ };
41
+ readonly outputSchema: {
42
+ type: "object";
43
+ properties: {
44
+ posts: {
45
+ type: string;
46
+ description: string;
47
+ items: {
48
+ type: string;
49
+ properties: {
50
+ id: {
51
+ type: string;
52
+ };
53
+ title: {
54
+ type: string;
55
+ };
56
+ author: {
57
+ type: string;
58
+ };
59
+ subreddit: {
60
+ type: string;
61
+ };
62
+ score: {
63
+ type: string;
64
+ };
65
+ numComments: {
66
+ type: string;
67
+ };
68
+ url: {
69
+ type: string;
70
+ };
71
+ permalink: {
72
+ type: string;
73
+ };
74
+ createdUtc: {
75
+ type: string;
76
+ };
77
+ };
78
+ };
79
+ };
80
+ count: {
81
+ type: string;
82
+ description: string;
83
+ };
84
+ };
85
+ };
86
+ constructor(service: RedditService);
87
+ execute(args: {
88
+ subreddit?: string;
89
+ sort?: 'hot' | 'top' | 'rising' | 'new' | 'controversial';
90
+ time?: 'hour' | 'day' | 'week' | 'month' | 'year' | 'all';
91
+ limit?: number;
92
+ }, _context: ToolExecutionContext): Promise<ToolExecutionResult>;
93
+ validateArgs(args: Record<string, any>): {
94
+ isValid: boolean;
95
+ errors?: string[];
96
+ };
97
+ }
98
+ //# sourceMappingURL=trending.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trending.d.ts","sourceRoot":"","sources":["../../src/tools/trending.ts"],"names":[],"mappings":"AACA;;GAEG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACzF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,qBAAa,kBAAmB,YAAW,KAAK;IA8DlC,OAAO,CAAC,QAAQ,CAAC,OAAO;IA7DpC,SAAgB,EAAE,oBAAoB;IACtC,SAAgB,IAAI,qBAAqB;IACzC,SAAgB,WAAW,qBAAqB;IAChD,SAAgB,WAAW,mIACuG;IAClI,SAAgB,QAAQ,YAAY;IACpC,SAAgB,OAAO,WAAW;IAClC,SAAgB,cAAc,SAAS;IAEvC,SAAgB,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;MAyBzB;IAEF,SAAgB,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAuB1B;gBAE2B,OAAO,EAAE,aAAa;IAE7C,OAAO,CACX,IAAI,EAAE;QACJ,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,IAAI,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,QAAQ,GAAG,KAAK,GAAG,eAAe,CAAC;QAC1D,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;QAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,EACD,QAAQ,EAAE,oBAAoB,GAC7B,OAAO,CAAC,mBAAmB,CAAC;IAqB/B,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE;CAcjF"}
@@ -0,0 +1,107 @@
1
+ "use strict";
2
+ // @ts-nocheck
3
+ /**
4
+ * @fileoverview ITool for fetching trending posts and subreddits via the Reddit channel adapter.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.RedditTrendingTool = void 0;
8
+ class RedditTrendingTool {
9
+ constructor(service) {
10
+ this.service = service;
11
+ this.id = 'redditTrending';
12
+ this.name = 'reddit.trending';
13
+ this.displayName = 'Reddit Trending';
14
+ this.description = 'Get trending posts from Reddit front page or a specific subreddit. Supports hot, top, rising, new, and controversial sorting.';
15
+ this.category = 'social';
16
+ this.version = '0.1.0';
17
+ this.hasSideEffects = false;
18
+ this.inputSchema = {
19
+ type: 'object',
20
+ required: [],
21
+ properties: {
22
+ subreddit: {
23
+ type: 'string',
24
+ description: 'Optional subreddit to fetch trending from (without r/ prefix). Omit for front page.',
25
+ },
26
+ sort: {
27
+ type: 'string',
28
+ enum: ['hot', 'top', 'rising', 'new', 'controversial'],
29
+ description: 'Sort order (default: hot)',
30
+ },
31
+ time: {
32
+ type: 'string',
33
+ enum: ['hour', 'day', 'week', 'month', 'year', 'all'],
34
+ description: 'Time filter (applies to top and controversial, default: day)',
35
+ },
36
+ limit: {
37
+ type: 'number',
38
+ description: 'Maximum number of results (1-100, default: 25)',
39
+ minimum: 1,
40
+ maximum: 100,
41
+ },
42
+ },
43
+ };
44
+ this.outputSchema = {
45
+ type: 'object',
46
+ properties: {
47
+ posts: {
48
+ type: 'array',
49
+ description: 'Trending posts',
50
+ items: {
51
+ type: 'object',
52
+ properties: {
53
+ id: { type: 'string' },
54
+ title: { type: 'string' },
55
+ author: { type: 'string' },
56
+ subreddit: { type: 'string' },
57
+ score: { type: 'number' },
58
+ numComments: { type: 'number' },
59
+ url: { type: 'string' },
60
+ permalink: { type: 'string' },
61
+ createdUtc: { type: 'number' },
62
+ },
63
+ },
64
+ },
65
+ count: { type: 'number', description: 'Number of posts returned' },
66
+ },
67
+ };
68
+ }
69
+ async execute(args, _context) {
70
+ try {
71
+ const posts = await this.service.getTrending({
72
+ subreddit: args.subreddit,
73
+ sort: args.sort,
74
+ time: args.time,
75
+ limit: args.limit,
76
+ });
77
+ return {
78
+ success: true,
79
+ output: {
80
+ posts,
81
+ count: posts.length,
82
+ },
83
+ };
84
+ }
85
+ catch (error) {
86
+ return { success: false, error: error.message };
87
+ }
88
+ }
89
+ validateArgs(args) {
90
+ const errors = [];
91
+ if (args.sort && !['hot', 'top', 'rising', 'new', 'controversial'].includes(args.sort)) {
92
+ errors.push('sort must be one of: hot, top, rising, new, controversial');
93
+ }
94
+ if (args.time && !['hour', 'day', 'week', 'month', 'year', 'all'].includes(args.time)) {
95
+ errors.push('time must be one of: hour, day, week, month, year, all');
96
+ }
97
+ if (args.limit !== undefined) {
98
+ if (typeof args.limit !== 'number')
99
+ errors.push('limit must be a number');
100
+ else if (args.limit < 1 || args.limit > 100)
101
+ errors.push('limit must be between 1 and 100');
102
+ }
103
+ return { isValid: errors.length === 0, errors };
104
+ }
105
+ }
106
+ exports.RedditTrendingTool = RedditTrendingTool;
107
+ //# sourceMappingURL=trending.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trending.js","sourceRoot":"","sources":["../../src/tools/trending.ts"],"names":[],"mappings":";AAAA,cAAc;AACd;;GAEG;;;AAKH,MAAa,kBAAkB;IA8D7B,YAA6B,OAAsB;QAAtB,YAAO,GAAP,OAAO,CAAe;QA7DnC,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IAAI,CAAC,2DAA2D,CAAC,CAAC;QAC3E,CAAC;QACD,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YACtF,MAAM,CAAC,IAAI,CAAC,wDAAwD,CAAC,CAAC;QACxE,CAAC;QACD,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YAC7B,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ;gBAAE,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;iBACrE,IAAI,IAAI,CAAC,KAAK,GAAG,CAAC,IAAI,IAAI,CAAC,KAAK,GAAG,GAAG;gBAAE,MAAM,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;QAC9F,CAAC;QACD,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IAClD,CAAC;CACF;AA3GD,gDA2GC"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * @fileoverview ITool for voting (upvote/downvote) on Reddit content via the Reddit channel adapter.
3
+ */
4
+ import type { ITool, ToolExecutionContext, ToolExecutionResult } from '@framers/agentos';
5
+ import type { RedditService } from '../RedditService';
6
+ export declare class RedditVoteTool implements ITool {
7
+ private readonly service;
8
+ readonly id = "redditVote";
9
+ readonly name = "reddit.vote";
10
+ readonly displayName = "Reddit Vote";
11
+ readonly description = "Upvote, downvote, or remove vote on a Reddit post or comment. Provide the fullname (e.g. t3_abc123 or t1_xyz789) and vote direction.";
12
+ readonly category = "social";
13
+ readonly version = "0.1.0";
14
+ readonly hasSideEffects = true;
15
+ readonly inputSchema: {
16
+ type: "object";
17
+ required: readonly ["thingId", "direction"];
18
+ properties: {
19
+ thingId: {
20
+ type: string;
21
+ description: string;
22
+ };
23
+ direction: {
24
+ type: string;
25
+ enum: string[];
26
+ description: string;
27
+ };
28
+ };
29
+ };
30
+ readonly outputSchema: {
31
+ type: "object";
32
+ properties: {
33
+ success: {
34
+ type: string;
35
+ description: string;
36
+ };
37
+ thingId: {
38
+ type: string;
39
+ description: string;
40
+ };
41
+ direction: {
42
+ type: string;
43
+ description: string;
44
+ };
45
+ };
46
+ };
47
+ constructor(service: RedditService);
48
+ execute(args: {
49
+ thingId: string;
50
+ direction: 'up' | 'down' | 'none';
51
+ }, _context: ToolExecutionContext): Promise<ToolExecutionResult>;
52
+ validateArgs(args: Record<string, any>): {
53
+ isValid: boolean;
54
+ errors?: string[];
55
+ };
56
+ }
57
+ //# sourceMappingURL=vote.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vote.d.ts","sourceRoot":"","sources":["../../src/tools/vote.ts"],"names":[],"mappings":"AACA;;GAEG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACzF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,qBAAa,cAAe,YAAW,KAAK;IAmC9B,OAAO,CAAC,QAAQ,CAAC,OAAO;IAlCpC,SAAgB,EAAE,gBAAgB;IAClC,SAAgB,IAAI,iBAAiB;IACrC,SAAgB,WAAW,iBAAiB;IAC5C,SAAgB,WAAW,0IAC8G;IACzI,SAAgB,QAAQ,YAAY;IACpC,SAAgB,OAAO,WAAW;IAClC,SAAgB,cAAc,QAAQ;IAEtC,SAAgB,WAAW;;;;;;;;;;;;;;MAczB;IAEF,SAAgB,YAAY;;;;;;;;;;;;;;;;MAO1B;gBAE2B,OAAO,EAAE,aAAa;IAE7C,OAAO,CACX,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAA;KAAE,EAC5D,QAAQ,EAAE,oBAAoB,GAC7B,OAAO,CAAC,mBAAmB,CAAC;IAiB/B,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE;CAUjF"}
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ // @ts-nocheck
3
+ /**
4
+ * @fileoverview ITool for voting (upvote/downvote) on Reddit content via the Reddit channel adapter.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.RedditVoteTool = void 0;
8
+ class RedditVoteTool {
9
+ constructor(service) {
10
+ this.service = service;
11
+ this.id = 'redditVote';
12
+ this.name = 'reddit.vote';
13
+ this.displayName = 'Reddit Vote';
14
+ this.description = 'Upvote, downvote, or remove vote on a Reddit post or comment. Provide the fullname (e.g. t3_abc123 or t1_xyz789) and vote direction.';
15
+ this.category = 'social';
16
+ this.version = '0.1.0';
17
+ this.hasSideEffects = true;
18
+ this.inputSchema = {
19
+ type: 'object',
20
+ required: ['thingId', 'direction'],
21
+ properties: {
22
+ thingId: {
23
+ type: 'string',
24
+ description: 'Reddit fullname of the post (t3_xxx) or comment (t1_xxx) to vote on',
25
+ },
26
+ direction: {
27
+ type: 'string',
28
+ enum: ['up', 'down', 'none'],
29
+ description: 'Vote direction: up (upvote), down (downvote), or none (remove vote)',
30
+ },
31
+ },
32
+ };
33
+ this.outputSchema = {
34
+ type: 'object',
35
+ properties: {
36
+ success: { type: 'boolean', description: 'Whether the vote was applied' },
37
+ thingId: { type: 'string', description: 'The thing that was voted on' },
38
+ direction: { type: 'string', description: 'The vote direction applied' },
39
+ },
40
+ };
41
+ }
42
+ async execute(args, _context) {
43
+ try {
44
+ await this.service.vote(args.thingId, args.direction);
45
+ return {
46
+ success: true,
47
+ output: {
48
+ success: true,
49
+ thingId: args.thingId,
50
+ direction: args.direction,
51
+ },
52
+ };
53
+ }
54
+ catch (error) {
55
+ return { success: false, error: error.message };
56
+ }
57
+ }
58
+ validateArgs(args) {
59
+ const errors = [];
60
+ if (!args.thingId)
61
+ errors.push('thingId is required');
62
+ else if (typeof args.thingId !== 'string')
63
+ errors.push('thingId must be a string');
64
+ if (!args.direction)
65
+ errors.push('direction is required');
66
+ else if (!['up', 'down', 'none'].includes(args.direction)) {
67
+ errors.push('direction must be one of: up, down, none');
68
+ }
69
+ return { isValid: errors.length === 0, errors };
70
+ }
71
+ }
72
+ exports.RedditVoteTool = RedditVoteTool;
73
+ //# sourceMappingURL=vote.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vote.js","sourceRoot":"","sources":["../../src/tools/vote.ts"],"names":[],"mappings":";AAAA,cAAc;AACd;;GAEG;;;AAKH,MAAa,cAAc;IAmCzB,YAA6B,OAAsB;QAAtB,YAAO,GAAP,OAAO,CAAe;QAlCnC,OAAE,GAAG,YAAY,CAAC;QAClB,SAAI,GAAG,aAAa,CAAC;QACrB,gBAAW,GAAG,aAAa,CAAC;QAC5B,gBAAW,GACzB,sIAAsI,CAAC;QACzH,aAAQ,GAAG,QAAQ,CAAC;QACpB,YAAO,GAAG,OAAO,CAAC;QAClB,mBAAc,GAAG,IAAI,CAAC;QAEtB,gBAAW,GAAG;YAC5B,IAAI,EAAE,QAAiB;YACvB,QAAQ,EAAE,CAAC,SAAS,EAAE,WAAW,CAAU;YAC3C,UAAU,EAAE;gBACV,OAAO,EAAE;oBACP,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,qEAAqE;iBACnF;gBACD,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC;oBAC5B,WAAW,EAAE,qEAAqE;iBACnF;aACF;SACF,CAAC;QAEc,iBAAY,GAAG;YAC7B,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,8BAA8B,EAAE;gBACzE,OAA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K,CAAC,EAAE,MAAM,EAAE,CAAC;IAClD,CAAC;CACF;AAnED,wCAmEC"}
package/manifest.json ADDED
@@ -0,0 +1,73 @@
1
+ {
2
+ "$schema": "https://agentos.sh/schemas/extension-manifest-v1.json",
3
+ "id": "com.framers.channels.reddit",
4
+ "name": "Reddit Channel Extension",
5
+ "version": "0.1.0",
6
+ "description": "Bidirectional Reddit interaction via snoowrap — supports posting, commenting, voting, searching, trending, subscriptions, messaging, and analytics.",
7
+ "categories": ["channel", "social"],
8
+ "platforms": ["reddit"],
9
+ "sdk": "snoowrap",
10
+ "extensions": [
11
+ {
12
+ "kind": "tool",
13
+ "id": "redditSubmitPost",
14
+ "displayName": "Submit Reddit Post"
15
+ },
16
+ {
17
+ "kind": "tool",
18
+ "id": "redditComment",
19
+ "displayName": "Reddit Comment"
20
+ },
21
+ {
22
+ "kind": "tool",
23
+ "id": "redditVote",
24
+ "displayName": "Reddit Vote"
25
+ },
26
+ {
27
+ "kind": "tool",
28
+ "id": "redditSearch",
29
+ "displayName": "Reddit Search"
30
+ },
31
+ {
32
+ "kind": "tool",
33
+ "id": "redditTrending",
34
+ "displayName": "Reddit Trending"
35
+ },
36
+ {
37
+ "kind": "tool",
38
+ "id": "redditSubscribe",
39
+ "displayName": "Reddit Subscribe"
40
+ },
41
+ {
42
+ "kind": "tool",
43
+ "id": "redditInbox",
44
+ "displayName": "Reddit Inbox"
45
+ },
46
+ {
47
+ "kind": "tool",
48
+ "id": "redditAnalytics",
49
+ "displayName": "Reddit Analytics"
50
+ },
51
+ {
52
+ "kind": "messaging-channel",
53
+ "id": "redditChannel",
54
+ "displayName": "Reddit Channel Adapter"
55
+ }
56
+ ],
57
+ "requiredSecrets": [
58
+ "reddit.clientId",
59
+ "reddit.clientSecret",
60
+ "reddit.username",
61
+ "reddit.password"
62
+ ],
63
+ "features": [
64
+ "Submit text, link, image, and poll posts to subreddits",
65
+ "Comment on posts and reply to comments",
66
+ "Upvote and downvote content",
67
+ "Search posts and subreddits with filters",
68
+ "Get trending posts and subreddits",
69
+ "Subscribe to and unsubscribe from subreddits",
70
+ "Read and send private messages",
71
+ "Post and comment karma analytics"
72
+ ]
73
+ }
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@framers/agentos-ext-channel-reddit",
3
+ "version": "0.1.0",
4
+ "description": "Reddit messaging channel adapter for AgentOS — bidirectional Reddit interaction via snoowrap",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "keywords": [
8
+ "agentos",
9
+ "extension",
10
+ "channel",
11
+ "reddit",
12
+ "snoowrap",
13
+ "social"
14
+ ],
15
+ "author": {
16
+ "name": "Framers AI",
17
+ "url": "https://frame.dev"
18
+ },
19
+ "license": "MIT",
20
+ "files": [
21
+ "dist",
22
+ "manifest.json"
23
+ ],
24
+ "peerDependencies": {
25
+ "@framers/agentos": "^0.5.2"
26
+ },
27
+ "dependencies": {
28
+ "snoowrap": "^1.23.0"
29
+ },
30
+ "devDependencies": {
31
+ "@framers/agentos": "^0.6.6",
32
+ "@types/node": "^20.0.0",
33
+ "typescript": "^5.0.0",
34
+ "vitest": "^1.0.0"
35
+ },
36
+ "engines": {
37
+ "node": ">=18.0.0"
38
+ },
39
+ "repository": {
40
+ "type": "git",
41
+ "url": "https://github.com/framersai/agentos-extensions",
42
+ "directory": "registry/curated/channels/reddit"
43
+ },
44
+ "scripts": {
45
+ "build": "tsc",
46
+ "dev": "tsc --watch",
47
+ "test": "vitest run",
48
+ "test:watch": "vitest watch",
49
+ "clean": "rm -rf dist"
50
+ }
51
+ }