diff --git a/surfsense_backend/app/capabilities/core/access/rest.py b/surfsense_backend/app/capabilities/core/access/rest.py
index 328a7c5a1..2047b21ae 100644
--- a/surfsense_backend/app/capabilities/core/access/rest.py
+++ b/surfsense_backend/app/capabilities/core/access/rest.py
@@ -71,6 +71,7 @@ class CapabilitySummary(BaseModel):
name: str
description: str
+ docs_url: str | None = None
input_schema: dict
output_schema: dict
# Empty list = free (billing disabled or an unmetered verb).
@@ -145,6 +146,7 @@ def _register_capabilities_list(
CapabilitySummary(
name=capability.name,
description=capability.description,
+ docs_url=capability.docs_url,
input_schema=capability.input_schema.model_json_schema(),
output_schema=capability.output_schema.model_json_schema(),
),
diff --git a/surfsense_backend/app/capabilities/core/types.py b/surfsense_backend/app/capabilities/core/types.py
index ec44d29aa..c87601832 100644
--- a/surfsense_backend/app/capabilities/core/types.py
+++ b/surfsense_backend/app/capabilities/core/types.py
@@ -62,3 +62,4 @@ class Capability:
output_schema: type[BaseModel]
executor: Executor
billing_unit: BillingUnit | None
+ docs_url: str | None = None
diff --git a/surfsense_backend/app/capabilities/reddit/scrape/definition.py b/surfsense_backend/app/capabilities/reddit/scrape/definition.py
index 01fb6db5f..fe00a77be 100644
--- a/surfsense_backend/app/capabilities/reddit/scrape/definition.py
+++ b/surfsense_backend/app/capabilities/reddit/scrape/definition.py
@@ -10,16 +10,14 @@ from app.capabilities.reddit.scrape.schemas import ScrapeInput, ScrapeOutput
REDDIT_SCRAPE = Capability(
name="reddit.scrape",
description=(
- "Scrape public Reddit data. Give it Reddit URLs (post, subreddit, or "
- "user) and/or search terms, and it returns structured items — posts "
- "(title, body, score, comment count, subreddit, author), their comments, "
- "and community/user metadata. Use search_queries (optionally scoped to a "
- "community) to discover posts, or urls to pull a known post/subreddit/user."
+ "Scrape public Reddit posts, comments, and metadata. Use urls or "
+ "search_queries."
),
input_schema=ScrapeInput,
output_schema=ScrapeOutput,
executor=build_scrape_executor(),
billing_unit=BillingUnit.REDDIT_ITEM,
+ docs_url="/docs/connectors/native/reddit",
)
register_capability(REDDIT_SCRAPE)
diff --git a/surfsense_web/app/dashboard/[workspace_id]/playground/components/api-reference.tsx b/surfsense_web/app/dashboard/[workspace_id]/playground/components/api-reference.tsx
index caf7cf9eb..beed5d525 100644
--- a/surfsense_web/app/dashboard/[workspace_id]/playground/components/api-reference.tsx
+++ b/surfsense_web/app/dashboard/[workspace_id]/playground/components/api-reference.tsx
@@ -22,10 +22,10 @@ function CopyButton({ text }: { text: string }) {
variant="ghost"
size="sm"
onClick={copy}
- className="absolute right-2 top-2 h-7 gap-1.5 px-2 text-xs"
+ aria-label={copied ? "Copied" : "Copy"}
+ className="absolute right-2 top-2 h-7 w-7 p-0"
>
{copied ?
- Call this API from your own project. Create a key in{" "}
- User settings and enable API access
- for this workspace, then send it as a{" "}
- Authorization: Bearer{" "}
- header.
+ Create an API key, enable API access for this workspace, then use the examples below to call this endpoint.
- Showing first {MAX_TABLE_ROWS} of {items.length} items. Use Copy JSON for the full + Showing first {MAX_TABLE_ROWS} of {items.length} items. Switch to JSON for the full output.
)} diff --git a/surfsense_web/app/dashboard/[workspace_id]/playground/components/playground-runner.tsx b/surfsense_web/app/dashboard/[workspace_id]/playground/components/playground-runner.tsx index d80af42f6..030c7c933 100644 --- a/surfsense_web/app/dashboard/[workspace_id]/playground/components/playground-runner.tsx +++ b/surfsense_web/app/dashboard/[workspace_id]/playground/components/playground-runner.tsx @@ -2,15 +2,13 @@ import { Check, - Coins, Copy, Hash, Info, - Loader2, - Play, + Coins, Timer, - X, } from "lucide-react"; +import Link from "next/link"; import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import { toast } from "sonner"; import { Alert, AlertDescription } from "@/components/ui/alert"; @@ -235,7 +233,21 @@ export function PlaygroundRunner({ workspaceId, platform, verb }: PlaygroundRunn{capability.description}
++ {capability.description} + {capability.docs_url ? ( + <> + {" "} + + Read docs + + . + > + ) : null} +