From ff79b78b5f88b23684c6539f2c04bb82efe2ced5 Mon Sep 17 00:00:00 2001 From: Waleed Date: Tue, 25 Nov 2025 19:50:23 -0800 Subject: [PATCH] feat(tools): added sentry, incidentio, and posthog tools (#2116) * feat(tools): added sentry, incidentio, and posthog tools * update docs * fixed docs to use native fumadocs for llms.txt and copy markdown, fixed tool issues * cleanup * enhance error extractor, fixed posthog tools * docs enhancements, cleanup * added more incident io ops, remove zustand/shallow in favor of zustand/react/shallow * fix type errors * remove unnecessary comments * added vllm to docs --- apps/docs/app/[lang]/[[...slug]]/page.tsx | 8 +- apps/docs/app/llms.mdx/[[...slug]]/route.ts | 6 +- apps/docs/cli.json | 11 + apps/docs/components/icons.tsx | 93 ++ apps/docs/components/ui/button.tsx | 27 + apps/docs/components/ui/copy-page-button.tsx | 29 +- apps/docs/components/ui/icon-mapping.ts | 6 + apps/docs/content/docs/en/blocks/agent.mdx | 2 +- .../docs/content/docs/en/blocks/evaluator.mdx | 2 +- .../content/docs/en/blocks/guardrails.mdx | 2 +- apps/docs/content/docs/en/blocks/router.mdx | 2 +- apps/docs/content/docs/en/execution/costs.mdx | 3 +- .../content/docs/en/introduction/index.mdx | 2 +- .../docs/content/docs/en/tools/incidentio.mdx | 846 +++++++++++++ apps/docs/content/docs/en/tools/knowledge.mdx | 9 + apps/docs/content/docs/en/tools/meta.json | 3 + apps/docs/content/docs/en/tools/posthog.mdx | 1117 +++++++++++++++++ apps/docs/content/docs/en/tools/sentry.mdx | 310 +++++ apps/docs/lib/cn.ts | 1 + apps/docs/lib/llms.ts | 32 +- apps/docs/middleware.ts | 21 +- .../user-input/hooks/use-mention-data.ts | 5 +- .../connection-blocks/connection-blocks.tsx | 7 +- .../components/tag-dropdown/tag-dropdown.tsx | 7 +- .../editor/hooks/use-block-connections.ts | 7 +- .../use-accessible-reference-prefixes.ts | 7 +- .../hooks/use-block-connections.ts | 7 +- .../hooks/use-current-workflow.ts | 32 +- apps/sim/blocks/blocks/incidentio.ts | 854 +++++++++++++ apps/sim/blocks/blocks/posthog.ts | 1075 ++++++++++++++++ apps/sim/blocks/blocks/sentry.ts | 565 +++++++++ apps/sim/blocks/registry.ts | 6 + apps/sim/components/icons.tsx | 83 ++ apps/sim/tools/error-extractors.test.ts | 57 +- apps/sim/tools/error-extractors.ts | 13 + apps/sim/tools/incidentio/actions_list.ts | 150 +++ apps/sim/tools/incidentio/actions_show.ts | 128 ++ .../tools/incidentio/custom_fields_create.ts | 90 ++ .../tools/incidentio/custom_fields_delete.ts | 52 + .../tools/incidentio/custom_fields_list.ts | 64 + .../tools/incidentio/custom_fields_show.ts | 67 + .../tools/incidentio/custom_fields_update.ts | 90 ++ .../incidentio/escalation_paths_create.ts | 136 ++ .../incidentio/escalation_paths_delete.ts | 55 + .../tools/incidentio/escalation_paths_show.ts | 111 ++ .../incidentio/escalation_paths_update.ts | 147 +++ .../tools/incidentio/escalations_create.ts | 99 ++ apps/sim/tools/incidentio/escalations_list.ts | 75 ++ apps/sim/tools/incidentio/escalations_show.ts | 63 + apps/sim/tools/incidentio/follow_ups_list.ts | 171 +++ apps/sim/tools/incidentio/follow_ups_show.ts | 149 +++ .../tools/incidentio/incident_roles_create.ts | 102 ++ .../tools/incidentio/incident_roles_delete.ts | 55 + .../tools/incidentio/incident_roles_list.ts | 75 ++ .../tools/incidentio/incident_roles_show.ts | 78 ++ .../tools/incidentio/incident_roles_update.ts | 108 ++ .../incidentio/incident_statuses_list.ts | 66 + .../incidentio/incident_timestamps_list.ts | 61 + .../incidentio/incident_timestamps_show.ts | 64 + .../tools/incidentio/incident_types_list.ts | 69 + .../tools/incidentio/incident_updates_list.ts | 136 ++ apps/sim/tools/incidentio/incidents_create.ts | 183 +++ apps/sim/tools/incidentio/incidents_list.ts | 174 +++ apps/sim/tools/incidentio/incidents_show.ts | 168 +++ apps/sim/tools/incidentio/incidents_update.ts | 184 +++ apps/sim/tools/incidentio/index.ts | 91 ++ .../tools/incidentio/schedule_entries_list.ts | 136 ++ .../incidentio/schedule_overrides_create.ts | 128 ++ apps/sim/tools/incidentio/schedules_create.ts | 84 ++ apps/sim/tools/incidentio/schedules_delete.ts | 55 + apps/sim/tools/incidentio/schedules_list.ts | 97 ++ apps/sim/tools/incidentio/schedules_show.ts | 64 + apps/sim/tools/incidentio/schedules_update.ts | 82 ++ apps/sim/tools/incidentio/severities_list.ts | 63 + apps/sim/tools/incidentio/types.ts | 916 ++++++++++++++ apps/sim/tools/incidentio/users_list.ts | 72 ++ apps/sim/tools/incidentio/users_show.ts | 63 + apps/sim/tools/incidentio/workflows_create.ts | 112 ++ apps/sim/tools/incidentio/workflows_delete.ts | 49 + apps/sim/tools/incidentio/workflows_list.ts | 113 ++ apps/sim/tools/incidentio/workflows_show.ts | 77 ++ apps/sim/tools/incidentio/workflows_update.ts | 112 ++ apps/sim/tools/index.test.ts | 99 +- apps/sim/tools/index.ts | 37 +- apps/sim/tools/params.ts | 2 - apps/sim/tools/posthog/batch_events.ts | 105 ++ apps/sim/tools/posthog/capture_event.ts | 129 ++ apps/sim/tools/posthog/create_annotation.ts | 197 +++ apps/sim/tools/posthog/create_cohort.ts | 232 ++++ apps/sim/tools/posthog/create_experiment.ts | 197 +++ apps/sim/tools/posthog/create_feature_flag.ts | 172 +++ apps/sim/tools/posthog/create_insight.ts | 223 ++++ apps/sim/tools/posthog/create_survey.ts | 217 ++++ apps/sim/tools/posthog/delete_feature_flag.ts | 78 ++ apps/sim/tools/posthog/delete_person.ts | 91 ++ apps/sim/tools/posthog/evaluate_flags.ts | 137 ++ apps/sim/tools/posthog/get_cohort.ts | 167 +++ apps/sim/tools/posthog/get_dashboard.ts | 150 +++ .../sim/tools/posthog/get_event_definition.ts | 153 +++ apps/sim/tools/posthog/get_experiment.ts | 108 ++ apps/sim/tools/posthog/get_feature_flag.ts | 117 ++ apps/sim/tools/posthog/get_insight.ts | 156 +++ apps/sim/tools/posthog/get_organization.ts | 153 +++ apps/sim/tools/posthog/get_person.ts | 123 ++ apps/sim/tools/posthog/get_project.ts | 177 +++ .../tools/posthog/get_property_definition.ts | 179 +++ .../tools/posthog/get_session_recording.ts | 130 ++ apps/sim/tools/posthog/get_survey.ts | 133 ++ apps/sim/tools/posthog/index.ts | 102 ++ apps/sim/tools/posthog/list_actions.ts | 173 +++ apps/sim/tools/posthog/list_annotations.ts | 179 +++ apps/sim/tools/posthog/list_cohorts.ts | 176 +++ apps/sim/tools/posthog/list_dashboards.ts | 167 +++ .../tools/posthog/list_event_definitions.ts | 170 +++ apps/sim/tools/posthog/list_events.ts | 190 +++ apps/sim/tools/posthog/list_experiments.ts | 139 ++ apps/sim/tools/posthog/list_feature_flags.ts | 141 +++ apps/sim/tools/posthog/list_insights.ts | 165 +++ apps/sim/tools/posthog/list_organizations.ts | 122 ++ apps/sim/tools/posthog/list_persons.ts | 159 +++ apps/sim/tools/posthog/list_projects.ts | 131 ++ .../posthog/list_property_definitions.ts | 193 +++ .../tools/posthog/list_recording_playlists.ts | 158 +++ .../tools/posthog/list_session_recordings.ts | 160 +++ apps/sim/tools/posthog/list_surveys.ts | 155 +++ apps/sim/tools/posthog/query.ts | 165 +++ apps/sim/tools/posthog/types.ts | 210 ++++ .../tools/posthog/update_event_definition.ts | 196 +++ apps/sim/tools/posthog/update_feature_flag.ts | 182 +++ .../posthog/update_property_definition.ts | 231 ++++ apps/sim/tools/posthog/update_survey.ts | 232 ++++ apps/sim/tools/registry.ts | 208 +++ apps/sim/tools/sentry/events_get.ts | 173 +++ apps/sim/tools/sentry/events_list.ts | 227 ++++ apps/sim/tools/sentry/index.ts | 16 + apps/sim/tools/sentry/issues_get.ts | 146 +++ apps/sim/tools/sentry/issues_list.ts | 226 ++++ apps/sim/tools/sentry/issues_update.ts | 173 +++ apps/sim/tools/sentry/projects_create.ts | 173 +++ apps/sim/tools/sentry/projects_get.ts | 153 +++ apps/sim/tools/sentry/projects_list.ts | 179 +++ apps/sim/tools/sentry/projects_update.ts | 183 +++ apps/sim/tools/sentry/releases_create.ts | 208 +++ apps/sim/tools/sentry/releases_deploy.ts | 137 ++ apps/sim/tools/sentry/releases_list.ts | 225 ++++ apps/sim/tools/sentry/types.ts | 389 ++++++ 146 files changed, 20971 insertions(+), 144 deletions(-) create mode 100644 apps/docs/cli.json create mode 100644 apps/docs/components/ui/button.tsx create mode 100644 apps/docs/content/docs/en/tools/incidentio.mdx create mode 100644 apps/docs/content/docs/en/tools/posthog.mdx create mode 100644 apps/docs/content/docs/en/tools/sentry.mdx create mode 100644 apps/docs/lib/cn.ts create mode 100644 apps/sim/blocks/blocks/incidentio.ts create mode 100644 apps/sim/blocks/blocks/posthog.ts create mode 100644 apps/sim/blocks/blocks/sentry.ts create mode 100644 apps/sim/tools/incidentio/actions_list.ts create mode 100644 apps/sim/tools/incidentio/actions_show.ts create mode 100644 apps/sim/tools/incidentio/custom_fields_create.ts create mode 100644 apps/sim/tools/incidentio/custom_fields_delete.ts create mode 100644 apps/sim/tools/incidentio/custom_fields_list.ts create mode 100644 apps/sim/tools/incidentio/custom_fields_show.ts create mode 100644 apps/sim/tools/incidentio/custom_fields_update.ts create mode 100644 apps/sim/tools/incidentio/escalation_paths_create.ts create mode 100644 apps/sim/tools/incidentio/escalation_paths_delete.ts create mode 100644 apps/sim/tools/incidentio/escalation_paths_show.ts create mode 100644 apps/sim/tools/incidentio/escalation_paths_update.ts create mode 100644 apps/sim/tools/incidentio/escalations_create.ts create mode 100644 apps/sim/tools/incidentio/escalations_list.ts create mode 100644 apps/sim/tools/incidentio/escalations_show.ts create mode 100644 apps/sim/tools/incidentio/follow_ups_list.ts create mode 100644 apps/sim/tools/incidentio/follow_ups_show.ts create mode 100644 apps/sim/tools/incidentio/incident_roles_create.ts create mode 100644 apps/sim/tools/incidentio/incident_roles_delete.ts create mode 100644 apps/sim/tools/incidentio/incident_roles_list.ts create mode 100644 apps/sim/tools/incidentio/incident_roles_show.ts create mode 100644 apps/sim/tools/incidentio/incident_roles_update.ts create mode 100644 apps/sim/tools/incidentio/incident_statuses_list.ts create mode 100644 apps/sim/tools/incidentio/incident_timestamps_list.ts create mode 100644 apps/sim/tools/incidentio/incident_timestamps_show.ts create mode 100644 apps/sim/tools/incidentio/incident_types_list.ts create mode 100644 apps/sim/tools/incidentio/incident_updates_list.ts create mode 100644 apps/sim/tools/incidentio/incidents_create.ts create mode 100644 apps/sim/tools/incidentio/incidents_list.ts create mode 100644 apps/sim/tools/incidentio/incidents_show.ts create mode 100644 apps/sim/tools/incidentio/incidents_update.ts create mode 100644 apps/sim/tools/incidentio/index.ts create mode 100644 apps/sim/tools/incidentio/schedule_entries_list.ts create mode 100644 apps/sim/tools/incidentio/schedule_overrides_create.ts create mode 100644 apps/sim/tools/incidentio/schedules_create.ts create mode 100644 apps/sim/tools/incidentio/schedules_delete.ts create mode 100644 apps/sim/tools/incidentio/schedules_list.ts create mode 100644 apps/sim/tools/incidentio/schedules_show.ts create mode 100644 apps/sim/tools/incidentio/schedules_update.ts create mode 100644 apps/sim/tools/incidentio/severities_list.ts create mode 100644 apps/sim/tools/incidentio/types.ts create mode 100644 apps/sim/tools/incidentio/users_list.ts create mode 100644 apps/sim/tools/incidentio/users_show.ts create mode 100644 apps/sim/tools/incidentio/workflows_create.ts create mode 100644 apps/sim/tools/incidentio/workflows_delete.ts create mode 100644 apps/sim/tools/incidentio/workflows_list.ts create mode 100644 apps/sim/tools/incidentio/workflows_show.ts create mode 100644 apps/sim/tools/incidentio/workflows_update.ts create mode 100644 apps/sim/tools/posthog/batch_events.ts create mode 100644 apps/sim/tools/posthog/capture_event.ts create mode 100644 apps/sim/tools/posthog/create_annotation.ts create mode 100644 apps/sim/tools/posthog/create_cohort.ts create mode 100644 apps/sim/tools/posthog/create_experiment.ts create mode 100644 apps/sim/tools/posthog/create_feature_flag.ts create mode 100644 apps/sim/tools/posthog/create_insight.ts create mode 100644 apps/sim/tools/posthog/create_survey.ts create mode 100644 apps/sim/tools/posthog/delete_feature_flag.ts create mode 100644 apps/sim/tools/posthog/delete_person.ts create mode 100644 apps/sim/tools/posthog/evaluate_flags.ts create mode 100644 apps/sim/tools/posthog/get_cohort.ts create mode 100644 apps/sim/tools/posthog/get_dashboard.ts create mode 100644 apps/sim/tools/posthog/get_event_definition.ts create mode 100644 apps/sim/tools/posthog/get_experiment.ts create mode 100644 apps/sim/tools/posthog/get_feature_flag.ts create mode 100644 apps/sim/tools/posthog/get_insight.ts create mode 100644 apps/sim/tools/posthog/get_organization.ts create mode 100644 apps/sim/tools/posthog/get_person.ts create mode 100644 apps/sim/tools/posthog/get_project.ts create mode 100644 apps/sim/tools/posthog/get_property_definition.ts create mode 100644 apps/sim/tools/posthog/get_session_recording.ts create mode 100644 apps/sim/tools/posthog/get_survey.ts create mode 100644 apps/sim/tools/posthog/index.ts create mode 100644 apps/sim/tools/posthog/list_actions.ts create mode 100644 apps/sim/tools/posthog/list_annotations.ts create mode 100644 apps/sim/tools/posthog/list_cohorts.ts create mode 100644 apps/sim/tools/posthog/list_dashboards.ts create mode 100644 apps/sim/tools/posthog/list_event_definitions.ts create mode 100644 apps/sim/tools/posthog/list_events.ts create mode 100644 apps/sim/tools/posthog/list_experiments.ts create mode 100644 apps/sim/tools/posthog/list_feature_flags.ts create mode 100644 apps/sim/tools/posthog/list_insights.ts create mode 100644 apps/sim/tools/posthog/list_organizations.ts create mode 100644 apps/sim/tools/posthog/list_persons.ts create mode 100644 apps/sim/tools/posthog/list_projects.ts create mode 100644 apps/sim/tools/posthog/list_property_definitions.ts create mode 100644 apps/sim/tools/posthog/list_recording_playlists.ts create mode 100644 apps/sim/tools/posthog/list_session_recordings.ts create mode 100644 apps/sim/tools/posthog/list_surveys.ts create mode 100644 apps/sim/tools/posthog/query.ts create mode 100644 apps/sim/tools/posthog/types.ts create mode 100644 apps/sim/tools/posthog/update_event_definition.ts create mode 100644 apps/sim/tools/posthog/update_feature_flag.ts create mode 100644 apps/sim/tools/posthog/update_property_definition.ts create mode 100644 apps/sim/tools/posthog/update_survey.ts create mode 100644 apps/sim/tools/sentry/events_get.ts create mode 100644 apps/sim/tools/sentry/events_list.ts create mode 100644 apps/sim/tools/sentry/index.ts create mode 100644 apps/sim/tools/sentry/issues_get.ts create mode 100644 apps/sim/tools/sentry/issues_list.ts create mode 100644 apps/sim/tools/sentry/issues_update.ts create mode 100644 apps/sim/tools/sentry/projects_create.ts create mode 100644 apps/sim/tools/sentry/projects_get.ts create mode 100644 apps/sim/tools/sentry/projects_list.ts create mode 100644 apps/sim/tools/sentry/projects_update.ts create mode 100644 apps/sim/tools/sentry/releases_create.ts create mode 100644 apps/sim/tools/sentry/releases_deploy.ts create mode 100644 apps/sim/tools/sentry/releases_list.ts create mode 100644 apps/sim/tools/sentry/types.ts diff --git a/apps/docs/app/[lang]/[[...slug]]/page.tsx b/apps/docs/app/[lang]/[[...slug]]/page.tsx index 8997592c10..003c1149ce 100644 --- a/apps/docs/app/[lang]/[[...slug]]/page.tsx +++ b/apps/docs/app/[lang]/[[...slug]]/page.tsx @@ -201,13 +201,7 @@ export default async function Page(props: { params: Promise<{ slug?: string[]; l
- +
diff --git a/apps/docs/app/llms.mdx/[[...slug]]/route.ts b/apps/docs/app/llms.mdx/[[...slug]]/route.ts index 837dce08d7..2f143fdc45 100644 --- a/apps/docs/app/llms.mdx/[[...slug]]/route.ts +++ b/apps/docs/app/llms.mdx/[[...slug]]/route.ts @@ -10,7 +10,11 @@ export async function GET(_req: NextRequest, { params }: { params: Promise<{ slu const page = source.getPage(slug) if (!page) notFound() - return new NextResponse(await getLLMText(page)) + return new NextResponse(await getLLMText(page), { + headers: { + 'Content-Type': 'text/markdown', + }, + }) } export function generateStaticParams() { diff --git a/apps/docs/cli.json b/apps/docs/cli.json new file mode 100644 index 0000000000..06dee4a2d2 --- /dev/null +++ b/apps/docs/cli.json @@ -0,0 +1,11 @@ +{ + "aliases": { + "uiDir": "./components/ui", + "componentsDir": "./components", + "blockDir": "./components", + "cssDir": "./styles", + "libDir": "./lib" + }, + "baseDir": "", + "commands": {} +} diff --git a/apps/docs/components/icons.tsx b/apps/docs/components/icons.tsx index b4dd059b70..a99241ff32 100644 --- a/apps/docs/components/icons.tsx +++ b/apps/docs/components/icons.tsx @@ -4150,3 +4150,96 @@ export function VideoIcon(props: SVGProps) { ) } + +export function VllmIcon(props: SVGProps) { + return ( + + vLLM + + + + ) +} + +export function PosthogIcon(props: SVGProps) { + return ( + + + + + + + + ) +} + +export function SentryIcon(props: SVGProps) { + return ( + + + + + + ) +} + +export function IncidentioIcon(props: SVGProps) { + return ( + + + + + + + + + + + ) +} diff --git a/apps/docs/components/ui/button.tsx b/apps/docs/components/ui/button.tsx new file mode 100644 index 0000000000..fe9ea6a766 --- /dev/null +++ b/apps/docs/components/ui/button.tsx @@ -0,0 +1,27 @@ +import { cva, type VariantProps } from 'class-variance-authority' + +const variants = { + primary: 'bg-fd-primary text-fd-primary-foreground hover:bg-fd-primary/80', + outline: 'border hover:bg-fd-accent hover:text-fd-accent-foreground', + ghost: 'hover:bg-fd-accent hover:text-fd-accent-foreground', + secondary: + 'border bg-fd-secondary text-fd-secondary-foreground hover:bg-fd-accent hover:text-fd-accent-foreground', +} as const + +export const buttonVariants = cva( + 'inline-flex items-center justify-center rounded-md p-2 text-sm font-medium transition-colors duration-100 disabled:pointer-events-none disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fd-ring', + { + variants: { + variant: variants, + color: variants, + size: { + sm: 'gap-1 px-2 py-1.5 text-xs', + icon: 'p-1.5 [&_svg]:size-5', + 'icon-sm': 'p-1.5 [&_svg]:size-4.5', + 'icon-xs': 'p-1 [&_svg]:size-4', + }, + }, + } +) + +export type ButtonProps = VariantProps diff --git a/apps/docs/components/ui/copy-page-button.tsx b/apps/docs/components/ui/copy-page-button.tsx index 782343e337..880600d453 100644 --- a/apps/docs/components/ui/copy-page-button.tsx +++ b/apps/docs/components/ui/copy-page-button.tsx @@ -3,25 +3,48 @@ import { useState } from 'react' import { Check, Copy } from 'lucide-react' +const cache = new Map() + interface CopyPageButtonProps { - content: string + markdownUrl: string } -export function CopyPageButton({ content }: CopyPageButtonProps) { +export function CopyPageButton({ markdownUrl }: CopyPageButtonProps) { const [copied, setCopied] = useState(false) + const [isLoading, setLoading] = useState(false) const handleCopy = async () => { + const cached = cache.get(markdownUrl) + if (cached) { + await navigator.clipboard.writeText(cached) + setCopied(true) + setTimeout(() => setCopied(false), 2000) + return + } + + setLoading(true) try { - await navigator.clipboard.writeText(content) + await navigator.clipboard.write([ + new ClipboardItem({ + 'text/plain': fetch(markdownUrl).then(async (res) => { + const content = await res.text() + cache.set(markdownUrl, content) + return content + }), + }), + ]) setCopied(true) setTimeout(() => setCopied(false), 2000) } catch (err) { console.error('Failed to copy:', err) + } finally { + setLoading(false) } } return (