Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/src/app/settings/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ export default function SettingsPage() {
{checkingStatus ? (
// Skeleton loading state
<>
{[1, 2, 3, 4, 5, 6, 7].map((i) => (
{[1, 2, 3, 4, 5, 6, 7, 8].map((i) => (
<div
key={i}
className="relative bg-background dark:bg-card/50 border border-border rounded-[16px] p-5 flex flex-col justify-between"
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/components/ProviderIcons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,9 @@ export const LinkedInIcon = () => (
<path d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z" />
</svg>
);

export const RedditIcon = () => (
<svg viewBox="0 0 24 24" className="w-6 h-6" fill="currentColor">
<path d="M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0zm5.01 4.744c.688 0 1.25.561 1.25 1.249a1.25 1.25 0 0 1-2.498.056l-2.597-.547-.8 3.747c1.824.07 3.48.632 4.674 1.488.308-.309.73-.491 1.207-.491.968 0 1.754.786 1.754 1.754 0 .716-.435 1.333-1.01 1.614a3.111 3.111 0 0 1 .042.52c0 2.694-3.13 4.87-7.004 4.87-3.874 0-7.004-2.176-7.004-4.87 0-.183.015-.366.043-.534A1.748 1.748 0 0 1 4.028 12c0-.968.786-1.754 1.754-1.754.463 0 .898.196 1.207.49 1.207-.883 2.878-1.43 4.744-1.487l.885-4.182a.342.342 0 0 1 .14-.197.35.35 0 0 1 .238-.042l2.906.617a1.214 1.214 0 0 1 1.108-.701zM9.25 12C8.561 12 8 12.562 8 13.25c0 .687.561 1.248 1.25 1.248.687 0 1.248-.561 1.248-1.249 0-.688-.561-1.249-1.249-1.249zm5.5 0c-.687 0-1.248.561-1.248 1.25 0 .687.561 1.248 1.249 1.248.688 0 1.249-.561 1.249-1.249 0-.687-.562-1.249-1.25-1.249zm-5.466 3.99a.327.327 0 0 0-.231.094.33.33 0 0 0 0 .463c.842.842 2.484.913 2.961.913.477 0 2.105-.056 2.961-.913a.361.361 0 0 0 .029-.463.33.33 0 0 0-.464 0c-.547.533-1.684.73-2.512.73-.828 0-1.979-.196-2.512-.73a.326.326 0 0 0-.232-.095z" />
</svg>
);
241 changes: 241 additions & 0 deletions frontend/src/lib/tools-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,246 @@ const spotifyTools: ToolDefinition[] = [
},
];

// Reddit Tools
const redditTools: ToolDefinition[] = [
{
tool_name: "Reddit.SubmitTextPost",
description: "Submit a text-based post to a subreddit.",
parameters: [
{
name: "subreddit",
type: "string",
required: true,
description:
"The name of the subreddit to which the post will be submitted.",
},
{
name: "title",
type: "string",
required: true,
description: "The title of the submission.",
},
{
name: "body",
type: "string",
required: false,
description:
"The body of the post in markdown format. Should never be the same as the title.",
},
{
name: "nsfw",
type: "boolean",
required: false,
description: "Indicates if the submission is NSFW.",
default: false,
},
{
name: "spoiler",
type: "boolean",
required: false,
description: "Indicates if the post is marked as a spoiler.",
default: false,
},
{
name: "send_replies",
type: "boolean",
required: false,
description: "If true, sends replies to the user's inbox.",
default: true,
},
],
category: "social",
},
{
tool_name: "Reddit.CommentOnPost",
description: "Comment on a Reddit post.",
parameters: [
{
name: "post_identifier",
type: "string",
required: true,
description:
"The identifier of the Reddit post. The identifier may be a Reddit URL, a permalink, a fullname, or a post id.",
},
{
name: "text",
type: "string",
required: true,
description: "The body of the comment in markdown format.",
},
],
category: "social",
},
{
tool_name: "Reddit.ReplyToComment",
description: "Reply to a Reddit comment.",
parameters: [
{
name: "comment_identifier",
type: "string",
required: true,
description:
"The identifier of the Reddit comment to reply to. The identifier may be a comment ID, a Reddit URL to the comment, a permalink to the comment, or the fullname of the comment.",
},
{
name: "text",
type: "string",
required: true,
description: "The body of the reply in markdown format.",
},
],
category: "social",
},
{
tool_name: "Reddit.GetPostsInSubreddit",
description:
"Gets posts titles, links, and other metadata in the specified subreddit.",
parameters: [
{
name: "subreddit",
type: "string",
required: true,
description: "The name of the subreddit to fetch posts from.",
},
{
name: "listing",
type: "string",
required: false,
description:
"The type of listing to fetch. Valid values are 'hot', 'new', 'rising', 'top', 'controversial'.",
default: "hot",
},
{
name: "limit",
type: "integer",
required: false,
description: "The maximum number of posts to fetch. Max is 100.",
default: 10,
},
{
name: "cursor",
type: "string",
required: false,
description: "The pagination token from a previous call.",
},
{
name: "time_range",
type: "string",
required: false,
description:
"The time range for filtering posts. Must be provided if the listing type is 'top' or 'controversial'. Valid values are 'NOW', 'TODAY', 'THIS_WEEK', 'THIS_MONTH', 'THIS_YEAR', 'ALL_TIME'.",
default: "TODAY",
},
],
category: "social",
},
{
tool_name: "Reddit.GetContentOfPost",
description: "Get the content (body) of a Reddit post by its identifier.",
parameters: [
{
name: "post_identifier",
type: "string",
required: true,
description:
"The identifier of the Reddit post. The identifier may be a Reddit URL, a permalink, a fullname, or a post id.",
},
],
category: "social",
},
{
tool_name: "Reddit.GetContentOfMultiplePosts",
description:
"Get the content (body) of multiple Reddit posts by their identifiers in a single request.",
parameters: [
{
name: "post_identifiers",
type: "array",
required: true,
description:
"A list of identifiers of the Reddit posts. The identifiers may be Reddit URLs, permalinks, fullnames, or post ids.",
},
],
category: "social",
},
{
tool_name: "Reddit.GetTopLevelComments",
description: "Get the first page of top-level comments of a Reddit post.",
parameters: [
{
name: "post_identifier",
type: "string",
required: true,
description:
"The identifier of the Reddit post. The identifier may be a Reddit URL, a permalink, a fullname, or a post id.",
},
],
category: "social",
},
{
tool_name: "Reddit.CheckSubredditAccess",
description:
"Checks whether the specified subreddit exists and also if it is accessible to the authenticated user.",
parameters: [
{
name: "subreddit",
type: "string",
required: true,
description: "The name of the subreddit to check.",
},
],
category: "social",
},
{
tool_name: "Reddit.GetSubredditRules",
description: "Gets the rules of the specified subreddit.",
parameters: [
{
name: "subreddit",
type: "string",
required: true,
description: "The name of the subreddit for which to fetch rules.",
},
],
category: "social",
},
{
tool_name: "Reddit.GetMyUsername",
description: "Gets the username of the authenticated user.",
parameters: [],
category: "social",
},
{
tool_name: "Reddit.GetMyPosts",
description:
"Get posts that were created by the authenticated user sorted by newest first.",
parameters: [
{
name: "limit",
type: "integer",
required: false,
description: "The maximum number of posts to fetch. Max is 100.",
default: 10,
},
{
name: "include_body",
type: "boolean",
required: false,
description:
"Whether to include the body of the posts in the response.",
default: true,
},
{
name: "cursor",
type: "string",
required: false,
description: "The pagination token from a previous call.",
},
],
category: "social",
},
];

// Combine all tools
const allTools: ToolDefinition[] = [
...twitterTools,
Expand All @@ -659,6 +899,7 @@ const allTools: ToolDefinition[] = [
...githubTools,
...notionTools,
...spotifyTools,
...redditTools,
];

export const toolsConfig: ToolsConfig = {
Expand Down
33 changes: 33 additions & 0 deletions frontend/src/lib/tools-providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
XIcon,
SpotifyIcon,
LinkedInIcon,
RedditIcon,
} from "../components/ProviderIcons";

// Centralized tools configuration for providers
Expand Down Expand Up @@ -113,6 +114,38 @@ export const toolsProviders: ToolProvider[] = [
enabled: true,
tools: [],
},
{
id: "reddit",
name: "Reddit",
description: "Integrate with Reddit",
icon: RedditIcon,
scopes: [
"read",
"submit",
"identity",
"subscribe",
"history",
"account",
"announcements",
"edit",
"flair",
"livemanage",
"modconfig",
"modlog",
"modothers",
"modtraffic",
"modwiki",
"mysubreddits",
"privatemessages",
"report",
"save",
"vote",
"wikiedit",
"wikiread",
],
enabled: true,
tools: [],
},
];

export default toolsProviders;