mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-28 03:00:29 -04:00
v0.6.37: audit logs page, isolated-vm worker rotation, permission groups ui
This commit is contained in:
@@ -423,7 +423,6 @@ export const {service}PollingTrigger: TriggerConfig = {
|
||||
subBlocks: [
|
||||
{ id: 'triggerCredentials', type: 'oauth-input', title: 'Credentials', serviceId: '{service}', requiredScopes: [], required: true, mode: 'trigger', supportsCredentialSets: true },
|
||||
// ... service-specific config fields (dropdowns, inputs, switches) ...
|
||||
{ id: 'triggerSave', type: 'trigger-save', title: '', hideFromPreview: true, mode: 'trigger', triggerId: '{service}_poller' },
|
||||
{ id: 'triggerInstructions', type: 'text', title: 'Setup Instructions', hideFromPreview: true, mode: 'trigger', defaultValue: '...' },
|
||||
],
|
||||
|
||||
@@ -486,7 +485,6 @@ Add to `helm/sim/values.yaml` under the existing polling cron jobs:
|
||||
- [ ] Handler implements `PollingProviderHandler` at `lib/webhooks/polling/{service}.ts`
|
||||
- [ ] Trigger config has `polling: true` and defines subBlocks manually (no `buildTriggerSubBlocks`)
|
||||
- [ ] Provider string matches across: trigger config, handler, `POLLING_PROVIDERS`, polling registry
|
||||
- [ ] `triggerSave` subBlock `triggerId` matches trigger config `id`
|
||||
- [ ] First poll seeds state and emits nothing
|
||||
- [ ] Added provider to `POLLING_PROVIDERS` in `triggers/constants.ts`
|
||||
- [ ] Added handler to `POLLING_HANDLERS` in `lib/webhooks/polling/registry.ts`
|
||||
|
||||
71
.claude/rules/constitution.md
Normal file
71
.claude/rules/constitution.md
Normal file
@@ -0,0 +1,71 @@
|
||||
# Sim — Language & Positioning
|
||||
|
||||
When editing user-facing copy (landing pages, docs, metadata, marketing), follow these rules.
|
||||
|
||||
## Identity
|
||||
|
||||
Sim is the **AI workspace** where teams build and run AI agents. Not a workflow tool, not an agent framework, not an automation platform.
|
||||
|
||||
**Short definition:** Sim is the open-source AI workspace where teams build, deploy, and manage AI agents.
|
||||
|
||||
**Full definition:** Sim is the open-source AI workspace where teams build, deploy, and manage AI agents. Connect 1,000+ integrations and every major LLM to create agents that automate real work — visually, conversationally, or with code.
|
||||
|
||||
## Audience
|
||||
|
||||
**Primary:** Teams building AI agents for their organization — IT, operations, and technical teams who need governance, security, lifecycle management, and collaboration.
|
||||
|
||||
**Secondary:** Individual builders and developers who care about speed, flexibility, and open source.
|
||||
|
||||
## Required Language
|
||||
|
||||
| Concept | Use | Never use |
|
||||
|---------|-----|-----------|
|
||||
| The product | "AI workspace" | "workflow tool", "automation platform", "agent framework" |
|
||||
| Building | "build agents", "create agents" | "create workflows" (unless describing the workflow module specifically) |
|
||||
| Visual builder | "workflow builder" or "visual builder" | "canvas", "graph editor" |
|
||||
| Mothership | "Mothership" (capitalized) | "chat", "AI assistant", "copilot" |
|
||||
| Deployment | "deploy", "ship" | "publish", "activate" |
|
||||
| Audience | "teams", "builders" | "users", "customers" (in marketing copy) |
|
||||
| What agents do | "automate real work" | "automate tasks", "automate workflows" |
|
||||
| Our advantage | "open-source AI workspace" | "open-source platform" |
|
||||
|
||||
## Tone
|
||||
|
||||
- **Direct.** Short sentences. Active voice. Lead with what it does.
|
||||
- **Concrete.** Name specific things — "Slack bots, compliance agents, data pipelines" — not abstractions.
|
||||
- **Confident, not loud.** No exclamation marks or superlatives.
|
||||
- **Simple.** If a 16-year-old can't understand the sentence, rewrite it.
|
||||
|
||||
## Claim Hierarchy
|
||||
|
||||
When describing Sim, always lead with the most differentiated claim:
|
||||
|
||||
1. **What it is:** "The AI workspace for teams"
|
||||
2. **What you do:** "Build, deploy, and manage AI agents"
|
||||
3. **How:** "Visually, conversationally, or with code"
|
||||
4. **Scale:** "1,000+ integrations, every major LLM"
|
||||
5. **Trust:** "Open source. SOC2. Trusted by 100,000+ builders."
|
||||
|
||||
## Module Descriptions
|
||||
|
||||
| Module | One-liner |
|
||||
|--------|-----------|
|
||||
| **Mothership** | Your AI command center. Build and manage everything in natural language. |
|
||||
| **Workflows** | The visual builder. Connect blocks, models, and integrations into agent logic. |
|
||||
| **Knowledge Base** | Your agents' memory. Upload docs, sync sources, build vector databases. |
|
||||
| **Tables** | A database, built in. Store, query, and wire structured data into agent runs. |
|
||||
| **Files** | Upload, create, and share. One store for your team and every agent. |
|
||||
| **Logs** | Full visibility, every run. Trace execution block by block. |
|
||||
|
||||
## What We Never Say
|
||||
|
||||
- Never call Sim "just a workflow tool"
|
||||
- Never compare only on integration count — we win on AI-native capabilities
|
||||
- Never use "no-code" as the primary descriptor — say "visually, conversationally, or with code"
|
||||
- Never promise unshipped features
|
||||
- Never use jargon ("RAG", "vector database", "MCP") without plain-English explanation on public pages
|
||||
- Avoid "agentic workforce" as a primary term — use "AI agents"
|
||||
|
||||
## Vision
|
||||
|
||||
Sim becomes the default environment where teams build AI agents — not a tool you visit for one task, but a workspace you live in. Workflows are one module; Mothership is another. The workspace is the constant; the interface adapts.
|
||||
@@ -418,7 +418,6 @@ export const {service}PollingTrigger: TriggerConfig = {
|
||||
subBlocks: [
|
||||
{ id: 'triggerCredentials', type: 'oauth-input', title: 'Credentials', serviceId: '{service}', requiredScopes: [], required: true, mode: 'trigger', supportsCredentialSets: true },
|
||||
// ... service-specific config fields (dropdowns, inputs, switches) ...
|
||||
{ id: 'triggerSave', type: 'trigger-save', title: '', hideFromPreview: true, mode: 'trigger', triggerId: '{service}_poller' },
|
||||
{ id: 'triggerInstructions', type: 'text', title: 'Setup Instructions', hideFromPreview: true, mode: 'trigger', defaultValue: '...' },
|
||||
],
|
||||
|
||||
@@ -481,7 +480,6 @@ Add to `helm/sim/values.yaml` under the existing polling cron jobs:
|
||||
- [ ] Handler implements `PollingProviderHandler` at `lib/webhooks/polling/{service}.ts`
|
||||
- [ ] Trigger config has `polling: true` and defines subBlocks manually (no `buildTriggerSubBlocks`)
|
||||
- [ ] Provider string matches across: trigger config, handler, `POLLING_PROVIDERS`, polling registry
|
||||
- [ ] `triggerSave` subBlock `triggerId` matches trigger config `id`
|
||||
- [ ] First poll seeds state and emits nothing
|
||||
- [ ] Added provider to `POLLING_PROVIDERS` in `triggers/constants.ts`
|
||||
- [ ] Added handler to `POLLING_HANDLERS` in `lib/webhooks/polling/registry.ts`
|
||||
|
||||
76
.cursor/rules/constitution.mdc
Normal file
76
.cursor/rules/constitution.mdc
Normal file
@@ -0,0 +1,76 @@
|
||||
---
|
||||
description: Sim product language, positioning, and tone guidelines
|
||||
globs: ["apps/sim/app/(landing)/**", "apps/sim/app/(home)/**", "apps/docs/**", "apps/sim/app/manifest.ts", "apps/sim/app/sitemap.ts", "apps/sim/app/robots.ts", "apps/sim/app/llms.txt/**", "apps/sim/app/llms-full.txt/**", "apps/sim/app/(landing)/**/structured-data*", "apps/docs/**/structured-data*", "**/metadata*", "**/seo*"]
|
||||
---
|
||||
|
||||
# Sim — Language & Positioning
|
||||
|
||||
When editing user-facing copy (landing pages, docs, metadata, marketing), follow these rules.
|
||||
|
||||
## Identity
|
||||
|
||||
Sim is the **AI workspace** where teams build and run AI agents. Not a workflow tool, not an agent framework, not an automation platform.
|
||||
|
||||
**Short definition:** Sim is the open-source AI workspace where teams build, deploy, and manage AI agents.
|
||||
|
||||
**Full definition:** Sim is the open-source AI workspace where teams build, deploy, and manage AI agents. Connect 1,000+ integrations and every major LLM to create agents that automate real work — visually, conversationally, or with code.
|
||||
|
||||
## Audience
|
||||
|
||||
**Primary:** Teams building AI agents for their organization — IT, operations, and technical teams who need governance, security, lifecycle management, and collaboration.
|
||||
|
||||
**Secondary:** Individual builders and developers who care about speed, flexibility, and open source.
|
||||
|
||||
## Required Language
|
||||
|
||||
| Concept | Use | Never use |
|
||||
|---------|-----|-----------|
|
||||
| The product | "AI workspace" | "workflow tool", "automation platform", "agent framework" |
|
||||
| Building | "build agents", "create agents" | "create workflows" (unless describing the workflow module specifically) |
|
||||
| Visual builder | "workflow builder" or "visual builder" | "canvas", "graph editor" |
|
||||
| Mothership | "Mothership" (capitalized) | "chat", "AI assistant", "copilot" |
|
||||
| Deployment | "deploy", "ship" | "publish", "activate" |
|
||||
| Audience | "teams", "builders" | "users", "customers" (in marketing copy) |
|
||||
| What agents do | "automate real work" | "automate tasks", "automate workflows" |
|
||||
| Our advantage | "open-source AI workspace" | "open-source platform" |
|
||||
|
||||
## Tone
|
||||
|
||||
- **Direct.** Short sentences. Active voice. Lead with what it does.
|
||||
- **Concrete.** Name specific things — "Slack bots, compliance agents, data pipelines" — not abstractions.
|
||||
- **Confident, not loud.** No exclamation marks or superlatives.
|
||||
- **Simple.** If a 16-year-old can't understand the sentence, rewrite it.
|
||||
|
||||
## Claim Hierarchy
|
||||
|
||||
When describing Sim, always lead with the most differentiated claim:
|
||||
|
||||
1. **What it is:** "The AI workspace for teams"
|
||||
2. **What you do:** "Build, deploy, and manage AI agents"
|
||||
3. **How:** "Visually, conversationally, or with code"
|
||||
4. **Scale:** "1,000+ integrations, every major LLM"
|
||||
5. **Trust:** "Open source. SOC2. Trusted by 100,000+ builders."
|
||||
|
||||
## Module Descriptions
|
||||
|
||||
| Module | One-liner |
|
||||
|--------|-----------|
|
||||
| **Mothership** | Your AI command center. Build and manage everything in natural language. |
|
||||
| **Workflows** | The visual builder. Connect blocks, models, and integrations into agent logic. |
|
||||
| **Knowledge Base** | Your agents' memory. Upload docs, sync sources, build vector databases. |
|
||||
| **Tables** | A database, built in. Store, query, and wire structured data into agent runs. |
|
||||
| **Files** | Upload, create, and share. One store for your team and every agent. |
|
||||
| **Logs** | Full visibility, every run. Trace execution block by block. |
|
||||
|
||||
## What We Never Say
|
||||
|
||||
- Never call Sim "just a workflow tool"
|
||||
- Never compare only on integration count — we win on AI-native capabilities
|
||||
- Never use "no-code" as the primary descriptor — say "visually, conversationally, or with code"
|
||||
- Never promise unshipped features
|
||||
- Never use jargon ("RAG", "vector database", "MCP") without plain-English explanation on public pages
|
||||
- Avoid "agentic workforce" as a primary term — use "AI agents"
|
||||
|
||||
## Vision
|
||||
|
||||
Sim becomes the default environment where teams build AI agents — not a tool you visit for one task, but a workspace you live in. Workflows are one module; Mothership is another. The workspace is the constant; the interface adapts.
|
||||
@@ -280,12 +280,12 @@ export async function generateMetadata(props: {
|
||||
title: data.title,
|
||||
description:
|
||||
data.description ||
|
||||
'Documentation for Sim — the open-source platform to build AI agents and run your agentic workforce.',
|
||||
'Documentation for Sim — the open-source AI workspace where teams build, deploy, and manage AI agents.',
|
||||
keywords: [
|
||||
'AI agents',
|
||||
'agentic workforce',
|
||||
'AI agent platform',
|
||||
'agentic workflows',
|
||||
'AI workspace',
|
||||
'AI agent builder',
|
||||
'build AI agents',
|
||||
'LLM orchestration',
|
||||
'AI automation',
|
||||
'knowledge base',
|
||||
@@ -300,7 +300,7 @@ export async function generateMetadata(props: {
|
||||
title: data.title,
|
||||
description:
|
||||
data.description ||
|
||||
'Documentation for Sim — the open-source platform to build AI agents and run your agentic workforce.',
|
||||
'Documentation for Sim — the open-source AI workspace where teams build, deploy, and manage AI agents.',
|
||||
url: fullUrl,
|
||||
siteName: 'Sim Documentation',
|
||||
type: 'article',
|
||||
@@ -322,7 +322,7 @@ export async function generateMetadata(props: {
|
||||
title: data.title,
|
||||
description:
|
||||
data.description ||
|
||||
'Documentation for Sim — the open-source platform to build AI agents and run your agentic workforce.',
|
||||
'Documentation for Sim — the open-source AI workspace where teams build, deploy, and manage AI agents.',
|
||||
images: [ogImageUrl],
|
||||
creator: '@simdotai',
|
||||
site: '@simdotai',
|
||||
|
||||
@@ -66,7 +66,7 @@ export default async function Layout({ children, params }: LayoutProps) {
|
||||
'@type': 'WebSite',
|
||||
name: 'Sim Documentation',
|
||||
description:
|
||||
'Documentation for Sim — the open-source platform to build AI agents and run your agentic workforce. Connect 1,000+ integrations and LLMs to deploy and orchestrate agentic workflows.',
|
||||
'Documentation for Sim — the open-source AI workspace where teams build, deploy, and manage AI agents. Connect 1,000+ integrations and every major LLM.',
|
||||
url: 'https://docs.sim.ai',
|
||||
publisher: {
|
||||
'@type': 'Organization',
|
||||
|
||||
@@ -14,29 +14,27 @@ export const viewport: Viewport = {
|
||||
export const metadata = {
|
||||
metadataBase: new URL('https://docs.sim.ai'),
|
||||
title: {
|
||||
default: 'Sim Documentation — Build AI Agents & Run Your Agentic Workforce',
|
||||
default: 'Sim Documentation — The AI Workspace for Teams',
|
||||
template: '%s | Sim Docs',
|
||||
},
|
||||
description:
|
||||
'Documentation for Sim — the open-source platform to build AI agents and run your agentic workforce. Connect 1,000+ integrations and LLMs to deploy and orchestrate agentic workflows.',
|
||||
'Documentation for Sim — the open-source AI workspace where teams build, deploy, and manage AI agents. Connect 1,000+ integrations and every major LLM.',
|
||||
applicationName: 'Sim Docs',
|
||||
generator: 'Next.js',
|
||||
referrer: 'origin-when-cross-origin' as const,
|
||||
keywords: [
|
||||
'AI workspace',
|
||||
'AI agent builder',
|
||||
'AI agents',
|
||||
'agentic workforce',
|
||||
'AI agent platform',
|
||||
'build AI agents',
|
||||
'open-source AI agents',
|
||||
'agentic workflows',
|
||||
'LLM orchestration',
|
||||
'AI integrations',
|
||||
'knowledge base',
|
||||
'AI automation',
|
||||
'workflow builder',
|
||||
'AI workflow orchestration',
|
||||
'visual workflow builder',
|
||||
'enterprise AI',
|
||||
'AI agent deployment',
|
||||
'intelligent automation',
|
||||
'AI tools',
|
||||
],
|
||||
authors: [{ name: 'Sim Team', url: 'https://sim.ai' }],
|
||||
@@ -65,9 +63,9 @@ export const metadata = {
|
||||
alternateLocale: ['es_ES', 'fr_FR', 'de_DE', 'ja_JP', 'zh_CN'],
|
||||
url: 'https://docs.sim.ai',
|
||||
siteName: 'Sim Documentation',
|
||||
title: 'Sim Documentation — Build AI Agents & Run Your Agentic Workforce',
|
||||
title: 'Sim Documentation — The AI Workspace for Teams',
|
||||
description:
|
||||
'Documentation for Sim — the open-source platform to build AI agents and run your agentic workforce. Connect 1,000+ integrations and LLMs to deploy and orchestrate agentic workflows.',
|
||||
'Documentation for Sim — the open-source AI workspace where teams build, deploy, and manage AI agents. Connect 1,000+ integrations and every major LLM.',
|
||||
images: [
|
||||
{
|
||||
url: 'https://docs.sim.ai/api/og?title=Sim%20Documentation',
|
||||
@@ -79,9 +77,9 @@ export const metadata = {
|
||||
},
|
||||
twitter: {
|
||||
card: 'summary_large_image',
|
||||
title: 'Sim Documentation — Build AI Agents & Run Your Agentic Workforce',
|
||||
title: 'Sim Documentation — The AI Workspace for Teams',
|
||||
description:
|
||||
'Documentation for Sim — the open-source platform to build AI agents and run your agentic workforce. Connect 1,000+ integrations and LLMs to deploy and orchestrate agentic workflows.',
|
||||
'Documentation for Sim — the open-source AI workspace where teams build, deploy, and manage AI agents. Connect 1,000+ integrations and every major LLM.',
|
||||
creator: '@simdotai',
|
||||
site: '@simdotai',
|
||||
images: ['https://docs.sim.ai/api/og?title=Sim%20Documentation'],
|
||||
|
||||
@@ -37,9 +37,9 @@ export async function GET() {
|
||||
|
||||
const manifest = `# Sim Documentation
|
||||
|
||||
> The open-source platform to build AI agents and run your agentic workforce.
|
||||
> The open-source AI workspace where teams build, deploy, and manage AI agents.
|
||||
|
||||
Sim is the open-source platform to build AI agents and run your agentic workforce. Connect 1,000+ integrations and LLMs to deploy and orchestrate agentic workflows. Create agents, workflows, knowledge bases, tables, and docs. Trusted by over 100,000 builders.
|
||||
Sim is the open-source AI workspace where teams build, deploy, and manage AI agents. Connect 1,000+ integrations and every major LLM to create agents that automate real work — visually, conversationally, or with code. Trusted by over 100,000 builders.
|
||||
|
||||
## Documentation Overview
|
||||
|
||||
|
||||
@@ -70,10 +70,11 @@ export function StructuredData({
|
||||
'@context': 'https://schema.org',
|
||||
'@type': 'SoftwareApplication',
|
||||
name: 'Sim',
|
||||
applicationCategory: 'DeveloperApplication',
|
||||
applicationCategory: 'BusinessApplication',
|
||||
applicationSubCategory: 'AI Workspace',
|
||||
operatingSystem: 'Any',
|
||||
description:
|
||||
'Sim is the open-source platform to build AI agents and run your agentic workforce. Connect 1,000+ integrations and LLMs to deploy and orchestrate agentic workflows. Create agents, workflows, knowledge bases, tables, and docs.',
|
||||
'Sim is the open-source AI workspace where teams build, deploy, and manage AI agents. Connect 1,000+ integrations and every major LLM to create agents that automate real work.',
|
||||
url: baseUrl,
|
||||
author: {
|
||||
'@type': 'Organization',
|
||||
@@ -84,8 +85,9 @@ export function StructuredData({
|
||||
category: 'Developer Tools',
|
||||
},
|
||||
featureList: [
|
||||
'AI agent creation',
|
||||
'Agentic workflow orchestration',
|
||||
'AI workspace for teams',
|
||||
'Mothership — natural language agent creation',
|
||||
'Visual workflow builder',
|
||||
'1,000+ integrations',
|
||||
'LLM orchestration (OpenAI, Anthropic, Google, xAI, Mistral, Perplexity)',
|
||||
'Knowledge base creation',
|
||||
|
||||
@@ -69,6 +69,9 @@ For self-hosted deployments, enterprise features can be enabled via environment
|
||||
| `ACCESS_CONTROL_ENABLED`, `NEXT_PUBLIC_ACCESS_CONTROL_ENABLED` | Permission groups for access restrictions |
|
||||
| `SSO_ENABLED`, `NEXT_PUBLIC_SSO_ENABLED` | Single Sign-On with SAML/OIDC |
|
||||
| `CREDENTIAL_SETS_ENABLED`, `NEXT_PUBLIC_CREDENTIAL_SETS_ENABLED` | Polling Groups for email triggers |
|
||||
| `INBOX_ENABLED`, `NEXT_PUBLIC_INBOX_ENABLED` | Sim Mailer inbox for outbound email |
|
||||
| `WHITELABELING_ENABLED`, `NEXT_PUBLIC_WHITELABELING_ENABLED` | Custom branding and white-labeling |
|
||||
| `AUDIT_LOGS_ENABLED`, `NEXT_PUBLIC_AUDIT_LOGS_ENABLED` | Audit logging for compliance and monitoring |
|
||||
| `DISABLE_INVITATIONS`, `NEXT_PUBLIC_DISABLE_INVITATIONS` | Globally disable workspace/organization invitations |
|
||||
|
||||
### Organization Management
|
||||
|
||||
@@ -170,17 +170,17 @@ Build, test, and refine workflows quickly with immediate feedback
|
||||
## Next Steps
|
||||
|
||||
<Cards>
|
||||
<Card title="Explore Workflow Blocks" href="/blocks">
|
||||
Discover API, Function, Condition, and other workflow blocks
|
||||
<Card title="Explore Blocks" href="/blocks">
|
||||
Discover API, Function, Condition, and other blocks
|
||||
</Card>
|
||||
<Card title="Browse Integrations" href="/tools">
|
||||
Connect 160+ services including Gmail, Slack, Notion, and more
|
||||
Connect 1,000+ services including Gmail, Slack, Notion, and more
|
||||
</Card>
|
||||
<Card title="Add Custom Logic" href="/blocks/function">
|
||||
Write custom functions for advanced data processing
|
||||
</Card>
|
||||
<Card title="Deploy Your Workflow" href="/execution">
|
||||
Make your workflow accessible via REST API or webhooks
|
||||
<Card title="Deploy Your Agent" href="/execution">
|
||||
Make your agent accessible via REST API or webhooks
|
||||
</Card>
|
||||
</Cards>
|
||||
|
||||
@@ -188,7 +188,7 @@ Build, test, and refine workflows quickly with immediate feedback
|
||||
|
||||
**Need detailed explanations?** Visit the [Blocks documentation](/blocks) for comprehensive guides on each component.
|
||||
|
||||
**Looking for integrations?** Explore the [Tools documentation](/tools) to see all 160+ available integrations.
|
||||
**Looking for integrations?** Explore the [Tools documentation](/tools) to see all 1,000+ available integrations.
|
||||
|
||||
**Ready to go live?** Learn about [Execution and Deployment](/execution) to make your workflows production-ready.
|
||||
|
||||
@@ -199,5 +199,5 @@ Build, test, and refine workflows quickly with immediate feedback
|
||||
{ question: "Can I use a different AI model instead of GPT-4o?", answer: "Yes. The Agent block supports models from OpenAI, Anthropic, Google, Groq, Cerebras, DeepSeek, Mistral, xAI, and more. You can select any available model from the dropdown. If you self-host, you can also use local models through Ollama." },
|
||||
{ question: "Can I import workflows from other tools?", answer: "Sim does not currently support importing workflows from other automation platforms. However, you can use the Copilot feature to describe what you want in natural language and have it build the workflow for you, which is often faster than manual recreation." },
|
||||
{ question: "What if my workflow does not produce the expected output?", answer: "Use the Chat panel to test iteratively and inspect outputs from each block. You can click the dropdown to view different block outputs and pinpoint where the issue is. The execution logs (accessible from the Logs tab) show detailed information about each step including token usage, costs, and any errors." },
|
||||
{ question: "Where do I go after completing this tutorial?", answer: "Explore the Blocks documentation to learn about Condition, Router, Function, and API blocks. Browse the Tools section to discover 160+ integrations you can add to your agents. When you are ready to deploy, check the Execution docs for REST API, webhook, and scheduled trigger options." },
|
||||
{ question: "Where do I go after completing this tutorial?", answer: "Explore the Blocks documentation to learn about Condition, Router, Function, and API blocks. Browse the Tools section to discover 1,000+ integrations you can add to your agents. When you are ready to deploy, check the Execution docs for REST API, webhook, and scheduled trigger options." },
|
||||
]} />
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Card, Cards } from 'fumadocs-ui/components/card'
|
||||
|
||||
# Sim Documentation
|
||||
|
||||
Welcome to Sim, a visual workflow builder for AI applications. Build powerful AI agents, automation workflows, and data processing pipelines by connecting blocks on a canvas.
|
||||
Welcome to Sim, the open-source AI workspace where teams build, deploy, and manage AI agents. Create agents visually with the workflow builder, conversationally through Mothership, or programmatically with the API — connected to 1,000+ integrations and every major LLM.
|
||||
|
||||
## Quick Start
|
||||
|
||||
@@ -15,13 +15,13 @@ Welcome to Sim, a visual workflow builder for AI applications. Build powerful AI
|
||||
Learn what you can build with Sim
|
||||
</Card>
|
||||
<Card title="Getting Started" href="/getting-started">
|
||||
Create your first workflow in 10 minutes
|
||||
Build your first agent in 10 minutes
|
||||
</Card>
|
||||
<Card title="Workflow Blocks" href="/blocks">
|
||||
<Card title="Blocks" href="/blocks">
|
||||
Learn about the building blocks
|
||||
</Card>
|
||||
<Card title="Tools & Integrations" href="/tools">
|
||||
Explore 80+ built-in integrations
|
||||
Explore 1,000+ integrations
|
||||
</Card>
|
||||
</Cards>
|
||||
|
||||
@@ -35,10 +35,10 @@ Welcome to Sim, a visual workflow builder for AI applications. Build powerful AI
|
||||
Work with workflow and environment variables
|
||||
</Card>
|
||||
<Card title="Execution" href="/execution">
|
||||
Monitor workflow runs and manage costs
|
||||
Monitor agent runs and manage costs
|
||||
</Card>
|
||||
<Card title="Triggers" href="/triggers">
|
||||
Start workflows via API, webhooks, or schedules
|
||||
Start agents via API, webhooks, or schedules
|
||||
</Card>
|
||||
</Cards>
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import { Image } from '@/components/ui/image'
|
||||
import { Video } from '@/components/ui/video'
|
||||
import { FAQ } from '@/components/ui/faq'
|
||||
|
||||
Sim is an open-source visual workflow builder for building and deploying AI agent workflows. Design intelligent automation systems using a no-code interface—connect AI models, databases, APIs, and business tools through an intuitive drag-and-drop canvas. Whether you're building chatbots, automating business processes, or orchestrating complex data pipelines, Sim provides the tools to bring your AI workflows to life.
|
||||
Sim is the open-source AI workspace where teams build, deploy, and manage AI agents. Create agents visually with the workflow builder, conversationally through Mothership, or programmatically with the API. Connect AI models, databases, APIs, and 1,000+ business tools to build agents that automate real work — from chatbots and compliance agents to data pipelines and ITSM automation.
|
||||
|
||||
<div className="flex justify-center">
|
||||
<Image
|
||||
@@ -40,8 +40,8 @@ Orchestrate complex multi-service interactions. Create unified API endpoints, im
|
||||
|
||||
## How It Works
|
||||
|
||||
**Visual Workflow Editor**
|
||||
Design workflows using an intuitive drag-and-drop canvas. Connect AI models, databases, APIs, and third-party services through a visual, no-code interface that makes complex automation logic easy to understand and maintain.
|
||||
**Visual Workflow Builder**
|
||||
Design agent logic using an intuitive drag-and-drop canvas. Connect AI models, databases, APIs, and third-party services through a visual interface that makes complex automation easy to understand and maintain.
|
||||
|
||||
**Modular Block System**
|
||||
Build with specialized components: processing blocks (AI agents, API calls, custom functions), logic blocks (conditional branching, loops, routers), and output blocks (responses, evaluators). Each block handles a specific task in your workflow.
|
||||
@@ -58,7 +58,7 @@ Enable your team to build together. Multiple users can edit workflows simultaneo
|
||||
|
||||
## Integrations
|
||||
|
||||
Sim provides native integrations with 160+ services across multiple categories:
|
||||
Sim provides native integrations with 1,000+ services across multiple categories:
|
||||
|
||||
- **AI Models**: OpenAI, Anthropic, Google Gemini, Groq, Cerebras, local models via Ollama or VLLM
|
||||
- **Communication**: Gmail, Slack, Microsoft Teams, Telegram, WhatsApp
|
||||
@@ -100,17 +100,17 @@ Deploy on your own infrastructure using Docker Compose or Kubernetes. Maintain c
|
||||
|
||||
## Next Steps
|
||||
|
||||
Ready to build your first AI workflow?
|
||||
Ready to build your first AI agent?
|
||||
|
||||
<Cards>
|
||||
<Card title="Getting Started" href="/getting-started">
|
||||
Create your first workflow in 10 minutes
|
||||
Build your first agent in 10 minutes
|
||||
</Card>
|
||||
<Card title="Workflow Blocks" href="/blocks">
|
||||
<Card title="Blocks" href="/blocks">
|
||||
Learn about the building blocks
|
||||
</Card>
|
||||
<Card title="Tools & Integrations" href="/tools">
|
||||
Explore 160+ built-in integrations
|
||||
Explore 1,000+ integrations
|
||||
</Card>
|
||||
<Card title="Team Permissions" href="/permissions/roles-and-permissions">
|
||||
Set up workspace roles and permissions
|
||||
@@ -121,9 +121,9 @@ Ready to build your first AI workflow?
|
||||
{ question: "Is Sim free to use?", answer: "Sim offers a free Community plan with 1,000 one-time credits to get started. Paid plans start at $25/month (Pro) with 5,000 credits and go up to $100/month (Max) with 20,000 credits. Annual billing is available at a 15% discount. You can also self-host Sim for free on your own infrastructure." },
|
||||
{ question: "Is Sim open source?", answer: "Yes. Sim is open source under the Apache 2.0 license. The full source code is available on GitHub and you can self-host it, contribute to development, or modify it for your own needs. Enterprise features (SSO, access control) have a separate license that requires a subscription for production use." },
|
||||
{ question: "Which AI models and providers are supported?", answer: "Sim supports 15+ providers including OpenAI, Anthropic, Google Gemini, Groq, Cerebras, DeepSeek, Mistral, xAI, and OpenRouter. You can also run local models through Ollama or VLLM at no API cost. Bring Your Own Key (BYOK) is supported so you can use your own API keys at base provider pricing with no markup." },
|
||||
{ question: "Do I need coding experience to use Sim?", answer: "No. Sim is a no-code visual builder where you design workflows by dragging blocks onto a canvas and connecting them. For advanced use cases, the Function block lets you write custom JavaScript, but it is entirely optional." },
|
||||
{ question: "Do I need coding experience to use Sim?", answer: "No. Sim lets you build agents visually by dragging blocks onto a canvas and connecting them, or conversationally through Mothership using natural language. For advanced use cases, the Function block lets you write custom JavaScript, and the full API/SDK is available for programmatic access." },
|
||||
{ question: "Can I self-host Sim?", answer: "Yes. Sim provides Docker Compose configurations for self-hosted deployments. The stack includes the Sim application, a PostgreSQL database with pgvector, and a realtime collaboration server. You can also integrate local AI models via Ollama for a fully offline setup." },
|
||||
{ question: "Is there a limit on how many workflows I can create?", answer: "There is no limit on the number of workflows you can create on any plan. Usage limits apply to execution credits, rate limits, and file storage, which vary by plan tier." },
|
||||
{ question: "What integrations are available?", answer: "Sim offers 160+ native integrations across categories including AI models, communication tools (Gmail, Slack, Teams, Telegram), productivity apps (Notion, Google Workspace, Airtable), development tools (GitHub, Jira, Linear), search services (Google Search, Perplexity, Exa), and databases (PostgreSQL, Supabase, Pinecone). For anything not built in, you can use the MCP (Model Context Protocol) support to connect custom services." },
|
||||
{ question: "How does Sim compare to other workflow automation tools?", answer: "Sim is purpose-built for AI agent workflows rather than general task automation. It provides a visual canvas for orchestrating LLM-powered agents with built-in support for tool use, structured outputs, conditional branching, and real-time collaboration. The Copilot feature also lets you build and modify workflows using natural language." },
|
||||
{ question: "What integrations are available?", answer: "Sim offers 1,000+ native integrations across categories including AI models, communication tools (Gmail, Slack, Teams, Telegram), productivity apps (Notion, Google Workspace, Airtable), development tools (GitHub, Jira, Linear), search services (Google Search, Perplexity, Exa), and databases (PostgreSQL, Supabase, Pinecone). For anything not built in, you can use the MCP (Model Context Protocol) support to connect custom services." },
|
||||
{ question: "How does Sim compare to other AI agent builders?", answer: "Sim is an AI workspace — not just a workflow tool or an agent framework. It combines a visual workflow builder, Mothership for natural-language agent creation, knowledge bases, tables, and full observability in one environment. Teams build agents visually, conversationally, or with code, then deploy and manage them with enterprise governance, real-time collaboration, and staging-to-production workflows." },
|
||||
]} />
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "Sim Documentation — Build AI Agents & Run Your Agentic Workforce",
|
||||
"name": "Sim Documentation — The AI Workspace for Teams",
|
||||
"short_name": "Sim Docs",
|
||||
"description": "Documentation for Sim — the open-source platform to build AI agents and run your agentic workforce. Connect 1,000+ integrations and LLMs to deploy and orchestrate agentic workflows.",
|
||||
"description": "Documentation for Sim — the open-source AI workspace where teams build, deploy, and manage AI agents. Connect 1,000+ integrations and every major LLM.",
|
||||
"start_url": "/",
|
||||
"scope": "/",
|
||||
"icons": [
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
# Sim Documentation
|
||||
|
||||
Sim is a visual workflow builder for AI applications that lets you build AI agent workflows visually. Create powerful AI agents, automation workflows, and data processing pipelines by connecting blocks on a canvas—no coding required.
|
||||
Sim is the open-source AI workspace where teams build, deploy, and manage AI agents. Create agents visually with the workflow builder, conversationally through Mothership, or programmatically with the API — connected to 1,000+ integrations and every major LLM.
|
||||
|
||||
## What is Sim?
|
||||
|
||||
Sim provides a complete ecosystem for AI workflow automation including:
|
||||
Sim provides a complete AI workspace including:
|
||||
- Mothership — natural language agent creation and workspace management
|
||||
- Visual workflow builder with drag-and-drop interface
|
||||
- AI agent creation and automation
|
||||
- 80+ built-in integrations (OpenAI, Slack, Gmail, GitHub, etc.)
|
||||
- 1,000+ built-in integrations (OpenAI, Anthropic, Slack, Gmail, GitHub, etc.)
|
||||
- Knowledge bases for retrieval-augmented generation
|
||||
- Built-in tables for structured data
|
||||
- Real-time team collaboration
|
||||
- Multiple deployment options (cloud-hosted or self-hosted)
|
||||
- Custom integrations via MCP protocol
|
||||
@@ -16,22 +18,22 @@ Sim provides a complete ecosystem for AI workflow automation including:
|
||||
|
||||
Here are the key areas covered in our documentation:
|
||||
|
||||
/introduction - Getting started with Sim visual workflow builder
|
||||
/getting-started - Quick start guide for building your first workflow
|
||||
/blocks - Understanding workflow blocks (AI agents, APIs, functions)
|
||||
/tools - 80+ built-in integrations and tools
|
||||
/introduction - Getting started with Sim AI workspace
|
||||
/getting-started - Quick start guide for building your first agent
|
||||
/blocks - Understanding blocks (AI agents, APIs, functions)
|
||||
/tools - 1,000+ integrations and tools
|
||||
/webhooks - Webhook triggers and handling
|
||||
/mcp - Custom integrations via MCP protocol
|
||||
/deployment - Cloud-hosted vs self-hosted deployment
|
||||
/permissions - Team collaboration and workspace management
|
||||
/collaboration - Real-time editing and team features
|
||||
/workflows - Building complex automation workflows
|
||||
/workflows - Building agent logic with the visual builder
|
||||
|
||||
## Technical Information
|
||||
|
||||
- Framework: Fumadocs (Next.js-based documentation platform)
|
||||
- Content: MDX files with interactive examples
|
||||
- Languages: English (primary), French, Chinese
|
||||
- Languages: English (primary), Spanish, French, German, Japanese, Chinese
|
||||
- Search: AI-powered search and assistance available
|
||||
|
||||
## Complete Documentation
|
||||
@@ -40,14 +42,10 @@ For the full documentation with all pages, examples, and interactive features, v
|
||||
|
||||
## Additional Resources
|
||||
|
||||
- GitHub repository with workflow examples
|
||||
- GitHub repository with agent examples
|
||||
- Discord community for support and discussions
|
||||
- 80+ built-in integrations with detailed guides
|
||||
- 1,000+ built-in integrations with detailed guides
|
||||
- MCP protocol documentation for custom integrations
|
||||
- Self-hosting guides and Docker deployment
|
||||
|
||||
For the complete documentation with interactive examples and visual workflow builder guides, visit https://docs.sim.ai
|
||||
|
||||
---
|
||||
|
||||
Last updated: 2025-09-15
|
||||
For the complete documentation visit https://docs.sim.ai
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use client'
|
||||
|
||||
import { useRef, useState } from 'react'
|
||||
import { useEffect, useRef, useState } from 'react'
|
||||
import { createLogger } from '@sim/logger'
|
||||
import { Eye, EyeOff, Loader2 } from 'lucide-react'
|
||||
import Link from 'next/link'
|
||||
@@ -20,6 +20,7 @@ import { validateCallbackUrl } from '@/lib/core/security/input-validation'
|
||||
import { cn } from '@/lib/core/utils/cn'
|
||||
import { getBaseUrl } from '@/lib/core/utils/urls'
|
||||
import { quickValidateEmail } from '@/lib/messaging/email/validation'
|
||||
import { captureClientEvent } from '@/lib/posthog/client'
|
||||
import { AUTH_SUBMIT_BTN } from '@/app/(auth)/components/auth-button-classes'
|
||||
import { SocialLoginButtons } from '@/app/(auth)/components/social-login-buttons'
|
||||
import { SSOLoginButton } from '@/app/(auth)/components/sso-login-button'
|
||||
@@ -113,6 +114,10 @@ export default function LoginPage({
|
||||
: null
|
||||
)
|
||||
|
||||
useEffect(() => {
|
||||
captureClientEvent('login_page_viewed', {})
|
||||
}, [])
|
||||
|
||||
const handleEmailChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
const newEmail = e.target.value
|
||||
setEmail(newEmail)
|
||||
|
||||
@@ -12,7 +12,7 @@ import { client, useSession } from '@/lib/auth/auth-client'
|
||||
import { getEnv, isFalsy, isTruthy } from '@/lib/core/config/env'
|
||||
import { cn } from '@/lib/core/utils/cn'
|
||||
import { quickValidateEmail } from '@/lib/messaging/email/validation'
|
||||
import { captureEvent } from '@/lib/posthog/client'
|
||||
import { captureClientEvent, captureEvent } from '@/lib/posthog/client'
|
||||
import { AUTH_SUBMIT_BTN } from '@/app/(auth)/components/auth-button-classes'
|
||||
import { SocialLoginButtons } from '@/app/(auth)/components/social-login-buttons'
|
||||
import { SSOLoginButton } from '@/app/(auth)/components/sso-login-button'
|
||||
@@ -71,15 +71,13 @@ const validateEmailField = (emailValue: string): string[] => {
|
||||
return errors
|
||||
}
|
||||
|
||||
function SignupFormContent({
|
||||
githubAvailable,
|
||||
googleAvailable,
|
||||
isProduction,
|
||||
}: {
|
||||
interface SignupFormProps {
|
||||
githubAvailable: boolean
|
||||
googleAvailable: boolean
|
||||
isProduction: boolean
|
||||
}) {
|
||||
}
|
||||
|
||||
function SignupFormContent({ githubAvailable, googleAvailable, isProduction }: SignupFormProps) {
|
||||
const router = useRouter()
|
||||
const searchParams = useSearchParams()
|
||||
const { refetch: refetchSession } = useSession()
|
||||
@@ -87,8 +85,8 @@ function SignupFormContent({
|
||||
const [isLoading, setIsLoading] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
captureEvent(posthog, 'signup_page_viewed', {})
|
||||
}, [posthog])
|
||||
captureClientEvent('signup_page_viewed', {})
|
||||
}, [])
|
||||
const [showPassword, setShowPassword] = useState(false)
|
||||
const [password, setPassword] = useState('')
|
||||
const [passwordErrors, setPasswordErrors] = useState<string[]>([])
|
||||
@@ -243,8 +241,6 @@ function SignupFormContent({
|
||||
return
|
||||
}
|
||||
|
||||
const sanitizedName = trimmedName
|
||||
|
||||
let token: string | undefined
|
||||
const widget = turnstileRef.current
|
||||
if (turnstileSiteKey && widget) {
|
||||
@@ -267,7 +263,7 @@ function SignupFormContent({
|
||||
{
|
||||
email: emailValue,
|
||||
password: passwordValue,
|
||||
name: sanitizedName,
|
||||
name: trimmedName,
|
||||
},
|
||||
{
|
||||
headers: {
|
||||
@@ -629,11 +625,7 @@ export default function SignupPage({
|
||||
githubAvailable,
|
||||
googleAvailable,
|
||||
isProduction,
|
||||
}: {
|
||||
githubAvailable: boolean
|
||||
googleAvailable: boolean
|
||||
isProduction: boolean
|
||||
}) {
|
||||
}: SignupFormProps) {
|
||||
return (
|
||||
<Suspense
|
||||
fallback={<div className='flex h-screen items-center justify-center'>Loading...</div>}
|
||||
|
||||
@@ -10,7 +10,7 @@ export default async function StudioLayout({ children }: { children: React.React
|
||||
name: 'Sim',
|
||||
url: 'https://sim.ai',
|
||||
description:
|
||||
'Sim is an open-source platform for building, testing, and deploying AI agent workflows.',
|
||||
'Sim is the open-source AI workspace where teams build, deploy, and manage AI agents.',
|
||||
logo: 'https://sim.ai/logo/primary/small.png',
|
||||
sameAs: [
|
||||
'https://x.com/simdotai',
|
||||
|
||||
@@ -19,8 +19,8 @@ export async function generateMetadata({
|
||||
const title = titleParts.join(' — ')
|
||||
|
||||
const description = tag
|
||||
? `Sim blog posts tagged "${tag}" — insights and guides for building AI agent workflows.`
|
||||
: 'Announcements, insights, and guides for building AI agent workflows.'
|
||||
? `Sim blog posts tagged "${tag}" — insights and guides for building AI agents.`
|
||||
: 'Announcements, insights, and guides for building AI agents.'
|
||||
|
||||
const canonicalParams = new URLSearchParams()
|
||||
if (tag) canonicalParams.set('tag', tag)
|
||||
|
||||
250
apps/sim/app/(landing)/components/auth-modal/auth-modal.tsx
Normal file
250
apps/sim/app/(landing)/components/auth-modal/auth-modal.tsx
Normal file
@@ -0,0 +1,250 @@
|
||||
'use client'
|
||||
|
||||
import { useCallback, useEffect, useMemo, useState } from 'react'
|
||||
import { createLogger } from '@sim/logger'
|
||||
import { Loader2, X } from 'lucide-react'
|
||||
import Image from 'next/image'
|
||||
import { useRouter } from 'next/navigation'
|
||||
import { Modal, ModalClose, ModalContent, ModalTitle, ModalTrigger } from '@/components/emcn'
|
||||
import { GithubIcon, GoogleIcon } from '@/components/icons'
|
||||
import { client } from '@/lib/auth/auth-client'
|
||||
import { getEnv, isFalsy, isTruthy } from '@/lib/core/config/env'
|
||||
import { captureClientEvent } from '@/lib/posthog/client'
|
||||
import type { PostHogEventMap } from '@/lib/posthog/events'
|
||||
import { getBrandConfig } from '@/ee/whitelabeling'
|
||||
|
||||
const logger = createLogger('AuthModal')
|
||||
|
||||
type AuthView = 'login' | 'signup'
|
||||
|
||||
interface AuthModalProps {
|
||||
children: React.ReactNode
|
||||
defaultView?: AuthView
|
||||
source: PostHogEventMap['auth_modal_opened']['source']
|
||||
}
|
||||
|
||||
interface ProviderStatus {
|
||||
githubAvailable: boolean
|
||||
googleAvailable: boolean
|
||||
registrationDisabled: boolean
|
||||
}
|
||||
|
||||
let fetchPromise: Promise<ProviderStatus> | null = null
|
||||
|
||||
const FALLBACK_STATUS: ProviderStatus = {
|
||||
githubAvailable: false,
|
||||
googleAvailable: false,
|
||||
registrationDisabled: false,
|
||||
}
|
||||
|
||||
const SOCIAL_BTN =
|
||||
'relative flex h-[32px] w-full items-center justify-center rounded-[5px] border border-[var(--landing-border-strong)] text-[13.5px] text-[var(--landing-text)] transition-colors hover:bg-[var(--landing-bg-elevated)] disabled:cursor-not-allowed disabled:opacity-50'
|
||||
|
||||
function fetchProviderStatus(): Promise<ProviderStatus> {
|
||||
if (fetchPromise) return fetchPromise
|
||||
fetchPromise = fetch('/api/auth/providers')
|
||||
.then((r) => {
|
||||
if (!r.ok) throw new Error(`HTTP ${r.status}`)
|
||||
return r.json()
|
||||
})
|
||||
.then(({ githubAvailable, googleAvailable, registrationDisabled }: ProviderStatus) => ({
|
||||
githubAvailable,
|
||||
googleAvailable,
|
||||
registrationDisabled,
|
||||
}))
|
||||
.catch(() => {
|
||||
fetchPromise = null
|
||||
return FALLBACK_STATUS
|
||||
})
|
||||
return fetchPromise
|
||||
}
|
||||
|
||||
export function AuthModal({ children, defaultView = 'login', source }: AuthModalProps) {
|
||||
const router = useRouter()
|
||||
const [open, setOpen] = useState(false)
|
||||
const [view, setView] = useState<AuthView>(defaultView)
|
||||
const [providerStatus, setProviderStatus] = useState<ProviderStatus | null>(null)
|
||||
const [socialLoading, setSocialLoading] = useState<'github' | 'google' | null>(null)
|
||||
const brand = useMemo(() => getBrandConfig(), [])
|
||||
|
||||
useEffect(() => {
|
||||
fetchProviderStatus().then(setProviderStatus)
|
||||
}, [])
|
||||
|
||||
const hasSocial = providerStatus?.githubAvailable || providerStatus?.googleAvailable
|
||||
const ssoEnabled = isTruthy(getEnv('NEXT_PUBLIC_SSO_ENABLED'))
|
||||
const emailEnabled = !isFalsy(getEnv('NEXT_PUBLIC_EMAIL_PASSWORD_SIGNUP_ENABLED'))
|
||||
const hasModalContent = hasSocial || ssoEnabled
|
||||
|
||||
useEffect(() => {
|
||||
if (!open || !providerStatus) return
|
||||
if (!hasModalContent) {
|
||||
setOpen(false)
|
||||
router.push(defaultView === 'login' ? '/login' : '/signup')
|
||||
return
|
||||
}
|
||||
if (providerStatus.registrationDisabled && view === 'signup') {
|
||||
setView('login')
|
||||
}
|
||||
}, [open, providerStatus, hasModalContent, defaultView, router, view])
|
||||
|
||||
const handleOpenChange = useCallback(
|
||||
(nextOpen: boolean) => {
|
||||
if (nextOpen && providerStatus && !hasModalContent) {
|
||||
router.push(defaultView === 'login' ? '/login' : '/signup')
|
||||
return
|
||||
}
|
||||
setOpen(nextOpen)
|
||||
if (nextOpen) {
|
||||
const initialView =
|
||||
defaultView === 'signup' && providerStatus?.registrationDisabled ? 'login' : defaultView
|
||||
setView(initialView)
|
||||
captureClientEvent('auth_modal_opened', { view: initialView, source })
|
||||
}
|
||||
},
|
||||
[defaultView, hasModalContent, providerStatus, router, source]
|
||||
)
|
||||
|
||||
const handleSocialLogin = useCallback(async (provider: 'github' | 'google') => {
|
||||
setSocialLoading(provider)
|
||||
try {
|
||||
await client.signIn.social({ provider, callbackURL: '/workspace' })
|
||||
} catch (error) {
|
||||
logger.warn('Social sign-in did not complete', { provider, error })
|
||||
} finally {
|
||||
setSocialLoading(null)
|
||||
}
|
||||
}, [])
|
||||
|
||||
const handleSSOLogin = useCallback(() => {
|
||||
setOpen(false)
|
||||
router.push('/sso')
|
||||
}, [router])
|
||||
|
||||
const handleEmailContinue = useCallback(() => {
|
||||
setOpen(false)
|
||||
router.push(view === 'login' ? '/login' : '/signup')
|
||||
}, [router, view])
|
||||
|
||||
return (
|
||||
<Modal open={open} onOpenChange={handleOpenChange}>
|
||||
<ModalTrigger asChild>{children}</ModalTrigger>
|
||||
<ModalContent
|
||||
size='sm'
|
||||
className='dark bg-[var(--landing-bg)] font-[430] font-season text-[var(--landing-text)]'
|
||||
>
|
||||
<ModalTitle className='sr-only'>
|
||||
{view === 'login' ? 'Log in' : 'Create account'}
|
||||
</ModalTitle>
|
||||
|
||||
<div className='relative px-6 pt-6 pb-6'>
|
||||
<ModalClose className='absolute top-6 right-6 rounded-sm opacity-70 transition-opacity hover:opacity-100'>
|
||||
<X className='h-5 w-5 text-[var(--landing-text-muted)]' />
|
||||
<span className='sr-only'>Close</span>
|
||||
</ModalClose>
|
||||
|
||||
{!providerStatus ? (
|
||||
<div className='flex items-center justify-center py-16'>
|
||||
<Loader2 className='h-5 w-5 animate-spin text-[var(--landing-text-muted)]' />
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
<div className='flex flex-col items-start gap-6 pe-10'>
|
||||
<Image
|
||||
src={brand.logoUrl || '/logo/sim-landing.svg'}
|
||||
alt={brand.name}
|
||||
width={71}
|
||||
height={22}
|
||||
unoptimized
|
||||
className='h-[22px] w-auto shrink-0 object-contain'
|
||||
/>
|
||||
<div className='flex flex-col gap-1 text-left'>
|
||||
<p className='text-[22px] text-[color-mix(in_srgb,var(--landing-text-subtle)_60%,transparent)] leading-[125%] tracking-[0.02em]'>
|
||||
Start building.
|
||||
</p>
|
||||
<h2 className='text-[22px] text-white leading-[110%] tracking-[-0.02em]'>
|
||||
{view === 'login' ? 'Log in to continue' : 'Create free account'}
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className='mt-6 space-y-3'>
|
||||
{providerStatus.googleAvailable && (
|
||||
<button
|
||||
type='button'
|
||||
onClick={() => handleSocialLogin('google')}
|
||||
disabled={!!socialLoading}
|
||||
className={SOCIAL_BTN}
|
||||
>
|
||||
<GoogleIcon className='absolute left-4 h-[18px] w-[18px] shrink-0' />
|
||||
<span>
|
||||
{socialLoading === 'google' ? 'Connecting...' : 'Continue with Google'}
|
||||
</span>
|
||||
</button>
|
||||
)}
|
||||
{providerStatus.githubAvailable && (
|
||||
<button
|
||||
type='button'
|
||||
onClick={() => handleSocialLogin('github')}
|
||||
disabled={!!socialLoading}
|
||||
className={SOCIAL_BTN}
|
||||
>
|
||||
<GithubIcon className='absolute left-4 h-[18px] w-[18px] shrink-0' />
|
||||
<span>
|
||||
{socialLoading === 'github' ? 'Connecting...' : 'Continue with GitHub'}
|
||||
</span>
|
||||
</button>
|
||||
)}
|
||||
{ssoEnabled && (
|
||||
<button type='button' onClick={handleSSOLogin} className={SOCIAL_BTN}>
|
||||
Sign in with SSO
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{emailEnabled && (
|
||||
<>
|
||||
<div className='relative my-4'>
|
||||
<div className='absolute inset-0 flex items-center'>
|
||||
<div className='w-full border-[var(--landing-bg-elevated)] border-t' />
|
||||
</div>
|
||||
<div className='relative flex justify-center text-[13.5px]'>
|
||||
<span className='bg-[var(--landing-bg)] px-4 text-[var(--landing-text-muted)]'>
|
||||
Or
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button
|
||||
type='button'
|
||||
onClick={handleEmailContinue}
|
||||
className='flex h-[32px] w-full items-center justify-center rounded-[5px] border border-[var(--auth-primary-btn-border)] bg-[var(--auth-primary-btn-bg)] text-[13.5px] text-[var(--auth-primary-btn-text)] transition-colors hover:border-[var(--auth-primary-btn-hover-border)] hover:bg-[var(--auth-primary-btn-hover-bg)]'
|
||||
>
|
||||
Continue with email
|
||||
</button>
|
||||
</>
|
||||
)}
|
||||
|
||||
<div className='mt-4 text-center text-[13.5px]'>
|
||||
<span className='text-[var(--landing-text-muted)]'>
|
||||
{view === 'login' ? "Don't have an account? " : 'Already have an account? '}
|
||||
</span>
|
||||
{view === 'login' && providerStatus.registrationDisabled ? (
|
||||
<span className='text-[var(--landing-text-muted)]'>Registration is disabled</span>
|
||||
) : (
|
||||
<button
|
||||
type='button'
|
||||
onClick={() => setView(view === 'login' ? 'signup' : 'login')}
|
||||
className='text-[var(--landing-text)] underline-offset-4 transition hover:text-white hover:underline'
|
||||
>
|
||||
{view === 'login' ? 'Sign up' : 'Sign in'}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</ModalContent>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
@@ -4,6 +4,8 @@ import { useCallback, useEffect, useRef, useState } from 'react'
|
||||
import Image from 'next/image'
|
||||
import Link from 'next/link'
|
||||
import { Badge } from '@/components/emcn'
|
||||
import { AuthModal } from '@/app/(landing)/components/auth-modal/auth-modal'
|
||||
import { trackLandingCta } from '@/app/(landing)/landing-analytics'
|
||||
|
||||
interface DotGridProps {
|
||||
className?: string
|
||||
@@ -250,10 +252,10 @@ export default function Collaboration() {
|
||||
</h2>
|
||||
|
||||
<p className='sr-only'>
|
||||
Sim supports real-time multiplayer collaboration. Teams can build AI agents together
|
||||
in a shared workspace with live cursors, presence indicators, and concurrent editing.
|
||||
Features include role-based access control, shared workflows, and team workspace
|
||||
management.
|
||||
Sim supports real-time multiplayer collaboration. Teams build AI agents together in a
|
||||
shared workspace with live cursors, presence indicators, and concurrent editing.
|
||||
Features include role-based access control, shared agents and workflows, and team
|
||||
workspace management.
|
||||
</p>
|
||||
|
||||
<p className='font-[430] font-season text-[#F6F6F0]/50 text-base leading-[150%] tracking-[0.02em] md:text-lg'>
|
||||
@@ -261,45 +263,54 @@ export default function Collaboration() {
|
||||
in real-time inside your workspace.
|
||||
</p>
|
||||
|
||||
<Link
|
||||
href='/signup'
|
||||
className='group/cta mt-3 inline-flex h-[32px] cursor-none items-center gap-1.5 rounded-[5px] border border-white bg-white px-2.5 font-[430] font-season text-black text-sm transition-colors hover:border-[#E0E0E0] hover:bg-[#E0E0E0]'
|
||||
>
|
||||
Build together
|
||||
<svg
|
||||
className='h-[10px] w-[10px] shrink-0'
|
||||
viewBox='0 0 10 10'
|
||||
fill='none'
|
||||
xmlns='http://www.w3.org/2000/svg'
|
||||
<AuthModal defaultView='signup' source='collaboration'>
|
||||
<button
|
||||
type='button'
|
||||
className='group/cta mt-3 inline-flex h-[32px] cursor-none items-center gap-1.5 rounded-[5px] border border-white bg-white px-2.5 font-[430] font-season text-black text-sm transition-colors hover:border-[#E0E0E0] hover:bg-[#E0E0E0]'
|
||||
onClick={() =>
|
||||
trackLandingCta({
|
||||
label: 'Build together',
|
||||
section: 'collaboration',
|
||||
destination: 'auth_modal',
|
||||
})
|
||||
}
|
||||
>
|
||||
<line
|
||||
x1='0'
|
||||
y1='5'
|
||||
x2='9'
|
||||
y2='5'
|
||||
stroke='currentColor'
|
||||
strokeWidth='1.33'
|
||||
strokeLinecap='square'
|
||||
className='origin-left scale-x-0 transition-transform duration-200 ease-out [transform-box:fill-box] group-hover/cta:scale-x-100'
|
||||
/>
|
||||
<path
|
||||
d='M3.5 2L6.5 5L3.5 8'
|
||||
stroke='currentColor'
|
||||
strokeWidth='1.33'
|
||||
strokeLinecap='square'
|
||||
strokeLinejoin='miter'
|
||||
Build together
|
||||
<svg
|
||||
className='h-[10px] w-[10px] shrink-0'
|
||||
viewBox='0 0 10 10'
|
||||
fill='none'
|
||||
className='transition-transform duration-200 ease-out group-hover/cta:translate-x-[30%]'
|
||||
/>
|
||||
</svg>
|
||||
</Link>
|
||||
xmlns='http://www.w3.org/2000/svg'
|
||||
>
|
||||
<line
|
||||
x1='0'
|
||||
y1='5'
|
||||
x2='9'
|
||||
y2='5'
|
||||
stroke='currentColor'
|
||||
strokeWidth='1.33'
|
||||
strokeLinecap='square'
|
||||
className='origin-left scale-x-0 transition-transform duration-200 ease-out [transform-box:fill-box] group-hover/cta:scale-x-100'
|
||||
/>
|
||||
<path
|
||||
d='M3.5 2L6.5 5L3.5 8'
|
||||
stroke='currentColor'
|
||||
strokeWidth='1.33'
|
||||
strokeLinecap='square'
|
||||
strokeLinejoin='miter'
|
||||
fill='none'
|
||||
className='transition-transform duration-200 ease-out group-hover/cta:translate-x-[30%]'
|
||||
/>
|
||||
</svg>
|
||||
</button>
|
||||
</AuthModal>
|
||||
</div>
|
||||
|
||||
<figure className='pointer-events-none relative h-[220px] w-full md:h-[600px]'>
|
||||
<div className='md:-left-[18%] -top-[10%] absolute inset-y-0 left-[7%] min-w-full md:top-0'>
|
||||
<Image
|
||||
src='/landing/collaboration-visual.svg'
|
||||
alt='Collaboration visual showing team workflows with real-time editing, shared cursors, and version control interface'
|
||||
alt='Collaboration visual showing teams building AI agents together with real-time editing, shared cursors, and version control'
|
||||
width={876}
|
||||
height={480}
|
||||
className='h-full w-auto object-left md:min-w-[100vw]'
|
||||
|
||||
@@ -3,9 +3,10 @@
|
||||
import { useRef, useState } from 'react'
|
||||
import { type MotionValue, motion, useScroll, useTransform } from 'framer-motion'
|
||||
import Image from 'next/image'
|
||||
import Link from 'next/link'
|
||||
import { Badge } from '@/components/emcn'
|
||||
import { AuthModal } from '@/app/(landing)/components/auth-modal/auth-modal'
|
||||
import { FeaturesPreview } from '@/app/(landing)/components/features/components/features-preview'
|
||||
import { trackLandingCta } from '@/app/(landing)/landing-analytics'
|
||||
|
||||
function hexToRgba(hex: string, alpha: number): string {
|
||||
const r = Number.parseInt(hex.slice(1, 3), 16)
|
||||
@@ -110,7 +111,7 @@ const FEATURE_TABS: FeatureTab[] = [
|
||||
},
|
||||
]
|
||||
|
||||
const HEADING_TEXT = 'Everything you need to build, deploy, and manage AI agents. '
|
||||
const HEADING_TEXT = 'One workspace to build, deploy, and manage AI agents. '
|
||||
const HEADING_LETTERS = HEADING_TEXT.split('')
|
||||
|
||||
const LETTER_REVEAL_SPAN = 0.85
|
||||
@@ -189,8 +190,7 @@ export default function Features() {
|
||||
</ScrollLetter>
|
||||
))}
|
||||
<span className='text-[color-mix(in_srgb,var(--landing-text-dark)_40%,transparent)]'>
|
||||
Design powerful workflows, connect your data, and monitor every run — all in one
|
||||
platform.
|
||||
Build agents, connect your data, and monitor every run — all in one workspace.
|
||||
</span>
|
||||
</h2>
|
||||
</div>
|
||||
@@ -265,12 +265,21 @@ export default function Features() {
|
||||
{FEATURE_TABS[activeTab].description}
|
||||
</p>
|
||||
</div>
|
||||
<Link
|
||||
href='/signup'
|
||||
className='inline-flex h-[32px] items-center rounded-[5px] border border-[#1D1D1D] bg-[#1D1D1D] px-2.5 font-[430] font-season text-sm text-white transition-colors hover:border-[var(--landing-bg-elevated)] hover:bg-[var(--landing-bg-elevated)]'
|
||||
>
|
||||
{FEATURE_TABS[activeTab].cta}
|
||||
</Link>
|
||||
<AuthModal defaultView='signup' source='features'>
|
||||
<button
|
||||
type='button'
|
||||
className='inline-flex h-[32px] items-center rounded-[5px] border border-[#1D1D1D] bg-[#1D1D1D] px-2.5 font-[430] font-season text-sm text-white transition-colors hover:border-[var(--landing-bg-elevated)] hover:bg-[var(--landing-bg-elevated)]'
|
||||
onClick={() =>
|
||||
trackLandingCta({
|
||||
label: FEATURE_TABS[activeTab].cta,
|
||||
section: 'features',
|
||||
destination: 'auth_modal',
|
||||
})
|
||||
}
|
||||
>
|
||||
{FEATURE_TABS[activeTab].cta}
|
||||
</button>
|
||||
</AuthModal>
|
||||
</div>
|
||||
|
||||
<FeaturesPreview activeTab={activeTab} />
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
|
||||
import { useCallback, useRef, useState } from 'react'
|
||||
import { ArrowUp } from 'lucide-react'
|
||||
import Link from 'next/link'
|
||||
import { cn } from '@/lib/core/utils/cn'
|
||||
import { captureClientEvent } from '@/lib/posthog/client'
|
||||
import { AuthModal } from '@/app/(landing)/components/auth-modal/auth-modal'
|
||||
import { useLandingSubmit } from '@/app/(landing)/components/landing-preview/components/landing-preview-panel/landing-preview-panel'
|
||||
import { trackLandingCta } from '@/app/(landing)/landing-analytics'
|
||||
import { useAnimatedPlaceholder } from '@/hooks/use-animated-placeholder'
|
||||
@@ -70,8 +71,8 @@ export function FooterCTA() {
|
||||
aria-label='Describe what you want to build'
|
||||
placeholder={animatedPlaceholder}
|
||||
rows={2}
|
||||
className='m-0 box-border min-h-[48px] w-full resize-none border-0 bg-transparent px-1 py-1 font-body text-[var(--landing-text)] text-base leading-[24px] tracking-[-0.015em] outline-none placeholder:font-[380] placeholder:text-[var(--landing-text-muted)] focus-visible:ring-0'
|
||||
style={{ caretColor: '#FFFFFF', maxHeight: `${MAX_HEIGHT}px` }}
|
||||
className='m-0 box-border min-h-[48px] w-full resize-none border-0 bg-transparent px-1 py-1 font-body text-[var(--landing-text)] text-base leading-[24px] tracking-[-0.015em] caret-white outline-none placeholder:font-[380] placeholder:text-[var(--landing-text-muted)] focus-visible:ring-0'
|
||||
style={{ maxHeight: `${MAX_HEIGHT}px` }}
|
||||
/>
|
||||
<div className='flex items-center justify-end'>
|
||||
<button
|
||||
@@ -79,11 +80,10 @@ export function FooterCTA() {
|
||||
onClick={handleSubmit}
|
||||
disabled={isEmpty}
|
||||
aria-label='Submit message'
|
||||
className='flex h-[28px] w-[28px] items-center justify-center rounded-full border-0 p-0 transition-colors'
|
||||
style={{
|
||||
background: isEmpty ? '#555555' : '#FFFFFF',
|
||||
cursor: isEmpty ? 'not-allowed' : 'pointer',
|
||||
}}
|
||||
className={cn(
|
||||
'flex h-[28px] w-[28px] items-center justify-center rounded-full border-0 p-0 transition-colors',
|
||||
isEmpty ? 'cursor-not-allowed bg-[#555555]' : 'cursor-pointer bg-white'
|
||||
)}
|
||||
>
|
||||
<ArrowUp size={16} strokeWidth={2.25} color={isEmpty ? '#888888' : '#1C1C1C'} />
|
||||
</button>
|
||||
@@ -96,7 +96,10 @@ export function FooterCTA() {
|
||||
href='https://docs.sim.ai'
|
||||
target='_blank'
|
||||
rel='noopener noreferrer'
|
||||
className={`${CTA_BUTTON} border-[var(--landing-border-strong)] text-[var(--landing-text)] transition-colors hover:bg-[var(--landing-bg-elevated)]`}
|
||||
className={cn(
|
||||
CTA_BUTTON,
|
||||
'border-[var(--landing-border-strong)] text-[var(--landing-text)] transition-colors hover:bg-[var(--landing-bg-elevated)]'
|
||||
)}
|
||||
onClick={() =>
|
||||
trackLandingCta({
|
||||
label: 'Docs',
|
||||
@@ -107,15 +110,24 @@ export function FooterCTA() {
|
||||
>
|
||||
Docs
|
||||
</a>
|
||||
<Link
|
||||
href='/signup'
|
||||
className={`${CTA_BUTTON} gap-2 border-white bg-white text-black transition-colors hover:border-[#E0E0E0] hover:bg-[#E0E0E0]`}
|
||||
onClick={() =>
|
||||
trackLandingCta({ label: 'Get started', section: 'footer_cta', destination: '/signup' })
|
||||
}
|
||||
>
|
||||
Get started
|
||||
</Link>
|
||||
<AuthModal defaultView='signup' source='footer_cta'>
|
||||
<button
|
||||
type='button'
|
||||
className={cn(
|
||||
CTA_BUTTON,
|
||||
'gap-2 border-white bg-white text-black transition-colors hover:border-[#E0E0E0] hover:bg-[#E0E0E0]'
|
||||
)}
|
||||
onClick={() =>
|
||||
trackLandingCta({
|
||||
label: 'Get started',
|
||||
section: 'footer_cta',
|
||||
destination: 'auth_modal',
|
||||
})
|
||||
}
|
||||
>
|
||||
Get started
|
||||
</button>
|
||||
</AuthModal>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import Image from 'next/image'
|
||||
import Link from 'next/link'
|
||||
import { cn } from '@/lib/core/utils/cn'
|
||||
import { FooterCTA } from '@/app/(landing)/components/footer/footer-cta'
|
||||
|
||||
const LINK_CLASS =
|
||||
@@ -9,25 +10,24 @@ interface FooterItem {
|
||||
label: string
|
||||
href: string
|
||||
external?: boolean
|
||||
arrow?: boolean
|
||||
externalArrow?: boolean
|
||||
}
|
||||
|
||||
const PRODUCT_LINKS: FooterItem[] = [
|
||||
{ label: 'Self Hosting', href: 'https://docs.sim.ai/self-hosting', external: true },
|
||||
{ label: 'MCP', href: 'https://docs.sim.ai/mcp', external: true },
|
||||
{ label: 'Mothership', href: 'https://docs.sim.ai', external: true },
|
||||
{ label: 'Workflows', href: 'https://docs.sim.ai', external: true },
|
||||
{ label: 'Knowledge Base', href: 'https://docs.sim.ai/knowledgebase', external: true },
|
||||
{ label: 'Tables', href: 'https://docs.sim.ai/tables', external: true },
|
||||
{ label: 'MCP', href: 'https://docs.sim.ai/mcp', external: true },
|
||||
{ label: 'API', href: 'https://docs.sim.ai/api-reference/getting-started', external: true },
|
||||
{ label: 'Self Hosting', href: 'https://docs.sim.ai/self-hosting', external: true },
|
||||
{ label: 'Status', href: 'https://status.sim.ai', external: true, externalArrow: true },
|
||||
]
|
||||
|
||||
const RESOURCES_LINKS: FooterItem[] = [
|
||||
{ label: 'Blog', href: '/blog' },
|
||||
// { label: 'Templates', href: '/templates' },
|
||||
{ label: 'Docs', href: 'https://docs.sim.ai', external: true },
|
||||
{ label: 'Models', href: '/models' },
|
||||
// { label: 'Academy', href: '/academy' },
|
||||
{ label: 'Partners', href: '/partners' },
|
||||
{ label: 'Careers', href: 'https://jobs.ashbyhq.com/sim', external: true, externalArrow: true },
|
||||
{ label: 'Changelog', href: '/changelog' },
|
||||
@@ -47,7 +47,7 @@ const BLOCK_LINKS: FooterItem[] = [
|
||||
]
|
||||
|
||||
const INTEGRATION_LINKS: FooterItem[] = [
|
||||
{ label: 'All Integrations', href: '/integrations', arrow: true },
|
||||
{ label: 'All Integrations', href: '/integrations' },
|
||||
{ label: 'Confluence', href: 'https://docs.sim.ai/tools/confluence', external: true },
|
||||
{ label: 'Slack', href: 'https://docs.sim.ai/tools/slack', external: true },
|
||||
{ label: 'GitHub', href: 'https://docs.sim.ai/tools/github', external: true },
|
||||
@@ -93,7 +93,7 @@ const LEGAL_LINKS: FooterItem[] = [
|
||||
function ChevronArrow({ external }: { external?: boolean }) {
|
||||
return (
|
||||
<svg
|
||||
className={`h-3 w-3 shrink-0${external ? ' -rotate-45' : ''}`}
|
||||
className={cn('h-3 w-3 shrink-0', external && '-rotate-45')}
|
||||
viewBox='0 0 10 10'
|
||||
fill='none'
|
||||
xmlns='http://www.w3.org/2000/svg'
|
||||
@@ -126,26 +126,24 @@ function FooterColumn({ title, items }: { title: string; items: FooterItem[] })
|
||||
<div>
|
||||
<h3 className='mb-4 font-medium text-[var(--landing-text)] text-sm'>{title}</h3>
|
||||
<div className='flex flex-col gap-2.5'>
|
||||
{items.map(({ label, href, external, arrow, externalArrow }) =>
|
||||
{items.map(({ label, href, external, externalArrow }) =>
|
||||
external ? (
|
||||
<a
|
||||
key={label}
|
||||
href={href}
|
||||
target='_blank'
|
||||
rel='noopener noreferrer'
|
||||
className={`${LINK_CLASS}${externalArrow ? ' group/link inline-flex items-center gap-1' : ''}`}
|
||||
className={cn(
|
||||
LINK_CLASS,
|
||||
externalArrow && 'group/link inline-flex items-center gap-1'
|
||||
)}
|
||||
>
|
||||
{label}
|
||||
{externalArrow && <ChevronArrow external />}
|
||||
</a>
|
||||
) : (
|
||||
<Link
|
||||
key={label}
|
||||
href={href}
|
||||
className={`${LINK_CLASS}${arrow ? ' group/link inline-flex items-center gap-1.5' : ''}`}
|
||||
>
|
||||
<Link key={label} href={href} className={LINK_CLASS}>
|
||||
{label}
|
||||
{arrow && <ChevronArrow />}
|
||||
</Link>
|
||||
)
|
||||
)}
|
||||
@@ -162,7 +160,10 @@ export default function Footer({ hideCTA }: FooterProps) {
|
||||
return (
|
||||
<footer
|
||||
role='contentinfo'
|
||||
className={`bg-[var(--landing-bg)] pb-10 font-[430] font-season text-sm${hideCTA ? ' pt-10' : ''}`}
|
||||
className={cn(
|
||||
'bg-[var(--landing-bg)] pb-10 font-[430] font-season text-sm',
|
||||
hideCTA && 'pt-10'
|
||||
)}
|
||||
>
|
||||
{!hideCTA && <FooterCTA />}
|
||||
<div className='relative px-[1.6vw] sm:px-8 lg:px-16'>
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
'use client'
|
||||
|
||||
import dynamic from 'next/dynamic'
|
||||
import Link from 'next/link'
|
||||
import { cn } from '@/lib/core/utils/cn'
|
||||
import { AuthModal } from '@/app/(landing)/components/auth-modal/auth-modal'
|
||||
import { DemoRequestModal } from '@/app/(landing)/components/demo-request/demo-request-modal'
|
||||
import { trackLandingCta } from '@/app/(landing)/landing-analytics'
|
||||
|
||||
@@ -16,7 +17,6 @@ const LandingPreview = dynamic(
|
||||
}
|
||||
)
|
||||
|
||||
/** Shared base classes for CTA link buttons — matches Deploy/Run button styling in the preview panel. */
|
||||
const CTA_BASE =
|
||||
'inline-flex items-center h-[32px] rounded-[5px] border px-2.5 font-[430] font-season text-sm'
|
||||
|
||||
@@ -30,11 +30,11 @@ export default function Hero() {
|
||||
className='relative flex flex-col items-center overflow-hidden bg-[var(--landing-bg)] pt-[60px] lg:pt-[100px]'
|
||||
>
|
||||
<p className='sr-only'>
|
||||
Sim is an open-source AI agent platform. Sim lets teams build AI agents and run an agentic
|
||||
workforce by connecting 1,000+ integrations and LLMs — including OpenAI, Anthropic Claude,
|
||||
Google Gemini, Mistral, and xAI Grok — to deploy and orchestrate agentic workflows. Users
|
||||
create agents, workflows, knowledge bases, tables, and docs. Sim is trusted by over 100,000
|
||||
builders at startups and Fortune 500 companies. Sim is SOC2 compliant.
|
||||
Sim is the open-source AI workspace where teams build, deploy, and manage AI agents. Connect
|
||||
1,000+ integrations and every major LLM — including OpenAI, Anthropic Claude, Google Gemini,
|
||||
Mistral, and xAI Grok — to create agents that automate real work. Build agents visually with
|
||||
the workflow builder, conversationally through Mothership, or programmatically with the API.
|
||||
Trusted by over 100,000 builders at startups and Fortune 500 companies. SOC2 compliant.
|
||||
</p>
|
||||
|
||||
<div className='relative z-10 flex flex-col items-center gap-3'>
|
||||
@@ -56,7 +56,10 @@ export default function Hero() {
|
||||
<DemoRequestModal theme='light'>
|
||||
<button
|
||||
type='button'
|
||||
className={`${CTA_BASE} border-[var(--landing-border-strong)] bg-transparent text-[var(--landing-text)] transition-colors hover:bg-[var(--landing-bg-elevated)]`}
|
||||
className={cn(
|
||||
CTA_BASE,
|
||||
'border-[var(--landing-border-strong)] bg-transparent text-[var(--landing-text)] transition-colors hover:bg-[var(--landing-bg-elevated)]'
|
||||
)}
|
||||
aria-label='Get a demo'
|
||||
onClick={() =>
|
||||
trackLandingCta({ label: 'Get a demo', section: 'hero', destination: 'demo_modal' })
|
||||
@@ -65,16 +68,25 @@ export default function Hero() {
|
||||
Get a demo
|
||||
</button>
|
||||
</DemoRequestModal>
|
||||
<Link
|
||||
href='/signup'
|
||||
className={`${CTA_BASE} gap-2 border-white bg-white text-black transition-colors hover:border-[#E0E0E0] hover:bg-[#E0E0E0]`}
|
||||
aria-label='Get started with Sim'
|
||||
onClick={() =>
|
||||
trackLandingCta({ label: 'Get started', section: 'hero', destination: '/signup' })
|
||||
}
|
||||
>
|
||||
Get started
|
||||
</Link>
|
||||
<AuthModal defaultView='signup' source='hero'>
|
||||
<button
|
||||
type='button'
|
||||
className={cn(
|
||||
CTA_BASE,
|
||||
'gap-2 border-white bg-white text-black transition-colors hover:border-[#E0E0E0] hover:bg-[#E0E0E0]'
|
||||
)}
|
||||
aria-label='Get started with Sim'
|
||||
onClick={() =>
|
||||
trackLandingCta({
|
||||
label: 'Get started',
|
||||
section: 'hero',
|
||||
destination: 'auth_modal',
|
||||
})
|
||||
}
|
||||
>
|
||||
Get started
|
||||
</button>
|
||||
</AuthModal>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
import { memo, useCallback, useEffect, useRef, useState } from 'react'
|
||||
import { AnimatePresence, motion } from 'framer-motion'
|
||||
import { ArrowUp } from 'lucide-react'
|
||||
import Link from 'next/link'
|
||||
import { useRouter } from 'next/navigation'
|
||||
import { createPortal } from 'react-dom'
|
||||
import { Blimp, BubbleChatPreview, ChevronDown, MoreHorizontal, Play } from '@/components/emcn'
|
||||
import { AgentIcon, HubspotIcon, OpenAIIcon, SalesforceIcon } from '@/components/icons'
|
||||
import { LandingPromptStorage } from '@/lib/core/utils/browser-storage'
|
||||
import { captureClientEvent } from '@/lib/posthog/client'
|
||||
import { AuthModal } from '@/app/(landing)/components/auth-modal/auth-modal'
|
||||
import {
|
||||
EASE_OUT,
|
||||
type EditorPromptData,
|
||||
@@ -19,6 +19,7 @@ import {
|
||||
TYPE_INTERVAL_MS,
|
||||
TYPE_START_BUFFER_MS,
|
||||
} from '@/app/(landing)/components/landing-preview/components/landing-preview-workflow/workflow-data'
|
||||
import { trackLandingCta } from '@/app/(landing)/landing-analytics'
|
||||
|
||||
type PanelTab = 'copilot' | 'editor'
|
||||
|
||||
@@ -44,6 +45,11 @@ export function useLandingSubmit() {
|
||||
const trimmed = text.trim()
|
||||
if (!trimmed) return
|
||||
LandingPromptStorage.store(trimmed)
|
||||
trackLandingCta({
|
||||
label: 'Prompt submit',
|
||||
section: 'landing_preview',
|
||||
destination: '/signup',
|
||||
})
|
||||
router.push('/signup')
|
||||
},
|
||||
[router]
|
||||
@@ -175,20 +181,29 @@ export const LandingPreviewPanel = memo(function LandingPreviewPanel({
|
||||
<BubbleChatPreview className='h-[14px] w-[14px] text-[#e6e6e6]' />
|
||||
</div>
|
||||
</div>
|
||||
<Link
|
||||
href='/signup'
|
||||
className='flex gap-1.5'
|
||||
onMouseMove={(e) => setCursorPos({ x: e.clientX, y: e.clientY })}
|
||||
onMouseLeave={() => setCursorPos(null)}
|
||||
>
|
||||
<div className='flex h-[30px] items-center rounded-[5px] bg-[#33C482] px-2.5 transition-colors hover:bg-[#2DAC72]'>
|
||||
<span className='font-medium text-[#1b1b1b] text-[12px]'>Deploy</span>
|
||||
</div>
|
||||
<div className='flex h-[30px] items-center gap-2 rounded-[5px] bg-[#33C482] px-2.5 transition-colors hover:bg-[#2DAC72]'>
|
||||
<Play className='h-[11.5px] w-[11.5px] text-[#1b1b1b]' />
|
||||
<span className='font-medium text-[#1b1b1b] text-[12px]'>Run</span>
|
||||
</div>
|
||||
</Link>
|
||||
<AuthModal defaultView='signup' source='landing_preview'>
|
||||
<button
|
||||
type='button'
|
||||
className='flex gap-1.5'
|
||||
onMouseMove={(e) => setCursorPos({ x: e.clientX, y: e.clientY })}
|
||||
onMouseLeave={() => setCursorPos(null)}
|
||||
onClick={() =>
|
||||
trackLandingCta({
|
||||
label: 'Deploy',
|
||||
section: 'landing_preview',
|
||||
destination: 'auth_modal',
|
||||
})
|
||||
}
|
||||
>
|
||||
<div className='flex h-[30px] items-center rounded-[5px] bg-[#33C482] px-2.5 transition-colors hover:bg-[#2DAC72]'>
|
||||
<span className='font-medium text-[#1b1b1b] text-[12px]'>Deploy</span>
|
||||
</div>
|
||||
<div className='flex h-[30px] items-center gap-2 rounded-[5px] bg-[#33C482] px-2.5 transition-colors hover:bg-[#2DAC72]'>
|
||||
<Play className='h-[11.5px] w-[11.5px] text-[#1b1b1b]' />
|
||||
<span className='font-medium text-[#1b1b1b] text-[12px]'>Run</span>
|
||||
</div>
|
||||
</button>
|
||||
</AuthModal>
|
||||
{cursorPos &&
|
||||
createPortal(
|
||||
<div
|
||||
|
||||
@@ -23,7 +23,7 @@ interface SidebarLink {
|
||||
external?: boolean
|
||||
}
|
||||
|
||||
const PLATFORM: ProductLink[] = [
|
||||
const WORKSPACE: ProductLink[] = [
|
||||
{
|
||||
label: 'Workflows',
|
||||
description: 'Visual AI automation builder',
|
||||
@@ -61,7 +61,7 @@ const PLATFORM: ProductLink[] = [
|
||||
},
|
||||
{
|
||||
label: 'API',
|
||||
description: 'Deploy workflows as endpoints',
|
||||
description: 'Deploy agents as endpoints',
|
||||
href: 'https://docs.sim.ai/api-reference/getting-started',
|
||||
external: true,
|
||||
icon: ApiIcon,
|
||||
@@ -106,13 +106,13 @@ export function ProductDropdown() {
|
||||
<div className='flex-1 p-2'>
|
||||
<div className='mb-1 px-2.5 pt-1'>
|
||||
<span className='font-[430] font-season text-[11px] text-[var(--landing-text-subtle)] uppercase tracking-[0.08em]'>
|
||||
Platform
|
||||
Workspace
|
||||
</span>
|
||||
<div className='mt-1.5 h-px bg-[var(--landing-bg-elevated)]' />
|
||||
</div>
|
||||
|
||||
<div className='grid grid-cols-2'>
|
||||
{PLATFORM.map((link) => (
|
||||
{WORKSPACE.map((link) => (
|
||||
<DropdownLink key={link.label} link={link} />
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -7,6 +7,7 @@ import { useSearchParams } from 'next/navigation'
|
||||
import { GithubOutlineIcon } from '@/components/icons'
|
||||
import { useSession } from '@/lib/auth/auth-client'
|
||||
import { cn } from '@/lib/core/utils/cn'
|
||||
import { AuthModal } from '@/app/(landing)/components/auth-modal/auth-modal'
|
||||
import {
|
||||
BlogDropdown,
|
||||
type NavBlogPost,
|
||||
@@ -29,6 +30,8 @@ interface NavLink {
|
||||
const NAV_LINKS: NavLink[] = [
|
||||
{ label: 'Docs', href: 'https://docs.sim.ai', external: true, icon: 'chevron', dropdown: 'docs' },
|
||||
{ label: 'Blog', href: '/blog', icon: 'chevron', dropdown: 'blog' },
|
||||
{ label: 'Integrations', href: '/integrations' },
|
||||
{ label: 'Models', href: '/models' },
|
||||
{ label: 'Pricing', href: '/#pricing' },
|
||||
]
|
||||
|
||||
@@ -225,30 +228,38 @@ export default function Navbar({ logoOnly = false, blogPosts = [] }: NavbarProps
|
||||
</Link>
|
||||
) : (
|
||||
<>
|
||||
<Link
|
||||
href='/login'
|
||||
className='inline-flex h-[30px] items-center rounded-[5px] border border-[var(--landing-border-strong)] px-[9px] text-[13.5px] text-[var(--landing-text)] transition-colors hover:bg-[var(--landing-bg-elevated)]'
|
||||
aria-label='Log in'
|
||||
onClick={() =>
|
||||
trackLandingCta({ label: 'Log in', section: 'navbar', destination: '/login' })
|
||||
}
|
||||
>
|
||||
Log in
|
||||
</Link>
|
||||
<Link
|
||||
href='/signup'
|
||||
className='inline-flex h-[30px] items-center gap-[7px] rounded-[5px] border border-[var(--white)] bg-[var(--white)] px-2.5 text-[13.5px] text-black transition-colors hover:border-[#E0E0E0] hover:bg-[#E0E0E0]'
|
||||
aria-label='Get started with Sim'
|
||||
onClick={() =>
|
||||
trackLandingCta({
|
||||
label: 'Get started',
|
||||
section: 'navbar',
|
||||
destination: '/signup',
|
||||
})
|
||||
}
|
||||
>
|
||||
Get started
|
||||
</Link>
|
||||
<AuthModal defaultView='login' source='navbar'>
|
||||
<button
|
||||
type='button'
|
||||
className='inline-flex h-[30px] items-center rounded-[5px] border border-[var(--landing-border-strong)] px-[9px] text-[13.5px] text-[var(--landing-text)] transition-colors hover:bg-[var(--landing-bg-elevated)]'
|
||||
aria-label='Log in'
|
||||
onClick={() =>
|
||||
trackLandingCta({
|
||||
label: 'Log in',
|
||||
section: 'navbar',
|
||||
destination: 'auth_modal',
|
||||
})
|
||||
}
|
||||
>
|
||||
Log in
|
||||
</button>
|
||||
</AuthModal>
|
||||
<AuthModal defaultView='signup' source='navbar'>
|
||||
<button
|
||||
type='button'
|
||||
className='inline-flex h-[30px] items-center gap-[7px] rounded-[5px] border border-[var(--white)] bg-[var(--white)] px-2.5 text-[13.5px] text-black transition-colors hover:border-[#E0E0E0] hover:bg-[#E0E0E0]'
|
||||
aria-label='Get started with Sim'
|
||||
onClick={() =>
|
||||
trackLandingCta({
|
||||
label: 'Get started',
|
||||
section: 'navbar',
|
||||
destination: 'auth_modal',
|
||||
})
|
||||
}
|
||||
>
|
||||
Get started
|
||||
</button>
|
||||
</AuthModal>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
@@ -335,32 +346,38 @@ export default function Navbar({ logoOnly = false, blogPosts = [] }: NavbarProps
|
||||
</Link>
|
||||
) : (
|
||||
<>
|
||||
<Link
|
||||
href='/login'
|
||||
className='flex h-[32px] items-center justify-center rounded-[5px] border border-[var(--landing-border-strong)] text-[14px] text-[var(--landing-text)] transition-colors active:bg-[var(--landing-bg-elevated)]'
|
||||
onClick={() => {
|
||||
trackLandingCta({ label: 'Log in', section: 'navbar', destination: '/login' })
|
||||
setMobileMenuOpen(false)
|
||||
}}
|
||||
aria-label='Log in'
|
||||
>
|
||||
Log in
|
||||
</Link>
|
||||
<Link
|
||||
href='/signup'
|
||||
className='flex h-[32px] items-center justify-center rounded-[5px] border border-[var(--white)] bg-[var(--white)] text-[14px] text-black transition-colors active:bg-[#E0E0E0]'
|
||||
onClick={() => {
|
||||
trackLandingCta({
|
||||
label: 'Get started',
|
||||
section: 'navbar',
|
||||
destination: '/signup',
|
||||
})
|
||||
setMobileMenuOpen(false)
|
||||
}}
|
||||
aria-label='Get started with Sim'
|
||||
>
|
||||
Get started
|
||||
</Link>
|
||||
<AuthModal defaultView='login' source='mobile_navbar'>
|
||||
<button
|
||||
type='button'
|
||||
className='flex h-[32px] items-center justify-center rounded-[5px] border border-[var(--landing-border-strong)] text-[14px] text-[var(--landing-text)] transition-colors active:bg-[var(--landing-bg-elevated)]'
|
||||
onClick={() =>
|
||||
trackLandingCta({
|
||||
label: 'Log in',
|
||||
section: 'navbar',
|
||||
destination: 'auth_modal',
|
||||
})
|
||||
}
|
||||
aria-label='Log in'
|
||||
>
|
||||
Log in
|
||||
</button>
|
||||
</AuthModal>
|
||||
<AuthModal defaultView='signup' source='mobile_navbar'>
|
||||
<button
|
||||
type='button'
|
||||
className='flex h-[32px] items-center justify-center rounded-[5px] border border-[var(--white)] bg-[var(--white)] text-[14px] text-black transition-colors active:bg-[#E0E0E0]'
|
||||
onClick={() =>
|
||||
trackLandingCta({
|
||||
label: 'Get started',
|
||||
section: 'navbar',
|
||||
destination: 'auth_modal',
|
||||
})
|
||||
}
|
||||
aria-label='Get started with Sim'
|
||||
>
|
||||
Get started
|
||||
</button>
|
||||
</AuthModal>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use client'
|
||||
|
||||
import Link from 'next/link'
|
||||
import { Badge } from '@/components/emcn'
|
||||
import { AuthModal } from '@/app/(landing)/components/auth-modal/auth-modal'
|
||||
import { DemoRequestModal } from '@/app/(landing)/components/demo-request/demo-request-modal'
|
||||
import { trackLandingCta } from '@/app/(landing)/landing-analytics'
|
||||
|
||||
@@ -37,7 +37,7 @@ const PRICING_TIERS: PricingTier[] = [
|
||||
{
|
||||
id: 'pro',
|
||||
name: 'Pro',
|
||||
description: 'For professionals building production workflows',
|
||||
description: 'For professionals deploying AI agents',
|
||||
price: '$25',
|
||||
billingPeriod: 'per month',
|
||||
color: '#00F701',
|
||||
@@ -55,7 +55,7 @@ const PRICING_TIERS: PricingTier[] = [
|
||||
{
|
||||
id: 'max',
|
||||
name: 'Max',
|
||||
description: 'For power users and teams building at scale',
|
||||
description: 'For teams building AI agents at scale',
|
||||
price: '$100',
|
||||
billingPeriod: 'per month',
|
||||
color: '#FA4EDF',
|
||||
@@ -163,33 +163,37 @@ function PricingCard({ tier }: PricingCardProps) {
|
||||
</button>
|
||||
</DemoRequestModal>
|
||||
) : isPro ? (
|
||||
<Link
|
||||
href={tier.cta.href || '/signup'}
|
||||
className='flex h-[32px] w-full items-center justify-center rounded-[5px] border border-[#1D1D1D] bg-[#1D1D1D] px-2.5 font-[430] font-season text-[14px] text-white transition-colors hover:border-[var(--landing-border)] hover:bg-[var(--landing-bg-elevated)]'
|
||||
onClick={() =>
|
||||
trackLandingCta({
|
||||
label: tier.cta.label,
|
||||
section: 'pricing',
|
||||
destination: tier.cta.href || '/signup',
|
||||
})
|
||||
}
|
||||
>
|
||||
{tier.cta.label}
|
||||
</Link>
|
||||
<AuthModal defaultView='signup' source='pricing'>
|
||||
<button
|
||||
type='button'
|
||||
className='flex h-[32px] w-full items-center justify-center rounded-[5px] border border-[#1D1D1D] bg-[#1D1D1D] px-2.5 font-[430] font-season text-[14px] text-white transition-colors hover:border-[var(--landing-border)] hover:bg-[var(--landing-bg-elevated)]'
|
||||
onClick={() =>
|
||||
trackLandingCta({
|
||||
label: tier.cta.label,
|
||||
section: 'pricing',
|
||||
destination: 'auth_modal',
|
||||
})
|
||||
}
|
||||
>
|
||||
{tier.cta.label}
|
||||
</button>
|
||||
</AuthModal>
|
||||
) : (
|
||||
<Link
|
||||
href={tier.cta.href || '/signup'}
|
||||
className='flex h-[32px] w-full items-center justify-center rounded-[5px] border border-[var(--landing-border-light)] px-2.5 font-[430] font-season text-[14px] text-[var(--landing-text-dark)] transition-colors hover:bg-[var(--landing-bg-hover)]'
|
||||
onClick={() =>
|
||||
trackLandingCta({
|
||||
label: tier.cta.label,
|
||||
section: 'pricing',
|
||||
destination: tier.cta.href || '/signup',
|
||||
})
|
||||
}
|
||||
>
|
||||
{tier.cta.label}
|
||||
</Link>
|
||||
<AuthModal defaultView='signup' source='pricing'>
|
||||
<button
|
||||
type='button'
|
||||
className='flex h-[32px] w-full items-center justify-center rounded-[5px] border border-[var(--landing-border-light)] px-2.5 font-[430] font-season text-[14px] text-[var(--landing-text-dark)] transition-colors hover:bg-[var(--landing-bg-hover)]'
|
||||
onClick={() =>
|
||||
trackLandingCta({
|
||||
label: tier.cta.label,
|
||||
section: 'pricing',
|
||||
destination: 'auth_modal',
|
||||
})
|
||||
}
|
||||
>
|
||||
{tier.cta.label}
|
||||
</button>
|
||||
</AuthModal>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -27,7 +27,7 @@ export default function StructuredData() {
|
||||
name: 'Sim',
|
||||
alternateName: 'Sim Studio',
|
||||
description:
|
||||
'Sim is the open-source platform to build AI agents and run your agentic workforce. Connect 1,000+ integrations and LLMs to deploy and orchestrate agentic workflows.',
|
||||
'Sim is the open-source AI workspace where teams build, deploy, and manage AI agents. Connect 1,000+ integrations and every major LLM to create agents that automate real work.',
|
||||
url: 'https://sim.ai',
|
||||
logo: {
|
||||
'@type': 'ImageObject',
|
||||
@@ -55,9 +55,9 @@ export default function StructuredData() {
|
||||
'@type': 'WebSite',
|
||||
'@id': 'https://sim.ai/#website',
|
||||
url: 'https://sim.ai',
|
||||
name: 'Sim — Build AI Agents & Run Your Agentic Workforce',
|
||||
name: 'Sim — The AI Workspace | Build, Deploy & Manage AI Agents',
|
||||
description:
|
||||
'Sim is the open-source platform to build AI agents and run your agentic workforce. Connect 1,000+ integrations and LLMs to deploy and orchestrate agentic workflows. Join 100,000+ builders.',
|
||||
'Sim is the open-source AI workspace where teams build, deploy, and manage AI agents. Connect 1,000+ integrations and every major LLM. Join 100,000+ builders.',
|
||||
publisher: { '@id': 'https://sim.ai/#organization' },
|
||||
inLanguage: 'en-US',
|
||||
},
|
||||
@@ -65,13 +65,13 @@ export default function StructuredData() {
|
||||
'@type': 'WebPage',
|
||||
'@id': 'https://sim.ai/#webpage',
|
||||
url: 'https://sim.ai',
|
||||
name: 'Sim — Build AI Agents & Run Your Agentic Workforce',
|
||||
name: 'Sim — The AI Workspace | Build, Deploy & Manage AI Agents',
|
||||
isPartOf: { '@id': 'https://sim.ai/#website' },
|
||||
about: { '@id': 'https://sim.ai/#software' },
|
||||
datePublished: '2024-01-01T00:00:00+00:00',
|
||||
dateModified: new Date().toISOString(),
|
||||
description:
|
||||
'Sim is the open-source platform to build AI agents and run your agentic workforce. Connect 1,000+ integrations and LLMs to deploy and orchestrate agentic workflows. Create agents, workflows, knowledge bases, tables, and docs.',
|
||||
'Sim is the open-source AI workspace where teams build, deploy, and manage AI agents. Connect 1,000+ integrations and every major LLM to create agents that automate real work.',
|
||||
breadcrumb: { '@id': 'https://sim.ai/#breadcrumb' },
|
||||
inLanguage: 'en-US',
|
||||
speakable: {
|
||||
@@ -91,12 +91,14 @@ export default function StructuredData() {
|
||||
'@type': 'WebApplication',
|
||||
'@id': 'https://sim.ai/#software',
|
||||
url: 'https://sim.ai',
|
||||
name: 'Sim — Build AI Agents & Run Your Agentic Workforce',
|
||||
name: 'Sim — The AI Workspace',
|
||||
description:
|
||||
'Sim is the open-source platform to build AI agents and run your agentic workforce. Connect 1,000+ integrations and LLMs to deploy and orchestrate agentic workflows. Create agents, workflows, knowledge bases, tables, and docs. Trusted by over 100,000 builders. SOC2 compliant.',
|
||||
applicationCategory: 'DeveloperApplication',
|
||||
'Sim is the open-source AI workspace where teams build, deploy, and manage AI agents. Connect 1,000+ integrations and every major LLM to create agents that automate real work — visually, conversationally, or with code. Trusted by over 100,000 builders. SOC2 compliant.',
|
||||
applicationCategory: 'BusinessApplication',
|
||||
applicationSubCategory: 'AI Workspace',
|
||||
operatingSystem: 'Web',
|
||||
browserRequirements: 'Requires a modern browser with JavaScript enabled',
|
||||
installUrl: 'https://sim.ai/signup',
|
||||
offers: [
|
||||
{
|
||||
'@type': 'Offer',
|
||||
@@ -135,8 +137,9 @@ export default function StructuredData() {
|
||||
},
|
||||
],
|
||||
featureList: [
|
||||
'AI agent creation',
|
||||
'Agentic workflow orchestration',
|
||||
'AI workspace for teams',
|
||||
'Mothership — natural language agent creation',
|
||||
'Visual workflow builder',
|
||||
'1,000+ integrations',
|
||||
'LLM orchestration (OpenAI, Anthropic, Google, xAI, Mistral, Perplexity)',
|
||||
'Knowledge base creation',
|
||||
@@ -176,19 +179,27 @@ export default function StructuredData() {
|
||||
codeRepository: 'https://github.com/simstudioai/sim',
|
||||
programmingLanguage: ['TypeScript', 'Python'],
|
||||
runtimePlatform: 'Node.js',
|
||||
license: 'https://opensource.org/licenses/AGPL-3.0',
|
||||
license: 'https://opensource.org/licenses/Apache-2.0',
|
||||
isPartOf: { '@id': 'https://sim.ai/#software' },
|
||||
},
|
||||
{
|
||||
'@type': 'FAQPage',
|
||||
'@id': 'https://sim.ai/#faq',
|
||||
mainEntity: [
|
||||
{
|
||||
'@type': 'Question',
|
||||
name: 'What is the best AI agent builder?',
|
||||
acceptedAnswer: {
|
||||
'@type': 'Answer',
|
||||
text: 'Sim is the open-source AI workspace trusted by over 100,000 builders for creating, deploying, and managing AI agents. Build agents visually with the workflow builder, conversationally through Mothership, or programmatically with the API. Sim connects to 1,000+ integrations and all major LLMs (OpenAI, Anthropic, Google, xAI, Mistral), and includes knowledge bases, tables, real-time collaboration, and enterprise governance. Free tier available. SOC2 compliant. Self-hostable.',
|
||||
},
|
||||
},
|
||||
{
|
||||
'@type': 'Question',
|
||||
name: 'What is Sim?',
|
||||
acceptedAnswer: {
|
||||
'@type': 'Answer',
|
||||
text: 'Sim is the open-source platform to build AI agents and run your agentic workforce. Teams connect 1,000+ integrations and LLMs to deploy and orchestrate agentic workflows. Create agents, workflows, knowledge bases, tables, and docs. Trusted by over 100,000 builders. SOC2 compliant.',
|
||||
text: 'Sim is the open-source AI workspace where teams build, deploy, and manage AI agents. Connect 1,000+ integrations and every major LLM to create agents that automate real work — visually, conversationally, or with code. The workspace includes Mothership for natural-language creation, a visual workflow builder, knowledge bases, tables, and full observability. Trusted by over 100,000 builders. SOC2 compliant.',
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -212,7 +223,7 @@ export default function StructuredData() {
|
||||
name: 'Do I need coding skills to use Sim?',
|
||||
acceptedAnswer: {
|
||||
'@type': 'Answer',
|
||||
text: 'No coding skills are required. Sim provides a visual interface for building AI agents and agentic workflows. Developers can also use custom functions, the API, and the CLI/SDK for advanced use cases.',
|
||||
text: 'No coding skills are required. Sim provides multiple ways to build agents: a visual workflow builder for drag-and-drop creation, Mothership for building in natural language, and templates for common use cases. Developers can also use custom functions, the API, and the CLI/SDK for advanced use cases.',
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -228,7 +239,7 @@ export default function StructuredData() {
|
||||
name: 'Is Sim open source?',
|
||||
acceptedAnswer: {
|
||||
'@type': 'Answer',
|
||||
text: 'Yes. Sim is fully open source under the AGPL-3.0 license. The source code is available on GitHub at github.com/simstudioai/sim. You can self-host Sim or use the hosted version at sim.ai.',
|
||||
text: 'Yes. Sim is fully open source under the Apache 2.0 license. The source code is available on GitHub at github.com/simstudioai/sim. You can self-host Sim or use the hosted version at sim.ai.',
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -9,6 +9,7 @@ import { Badge, ChevronDown } from '@/components/emcn'
|
||||
import { LandingWorkflowSeedStorage } from '@/lib/core/utils/browser-storage'
|
||||
import { cn } from '@/lib/core/utils/cn'
|
||||
import { TEMPLATE_WORKFLOWS } from '@/app/(landing)/components/templates/template-workflows'
|
||||
import { trackLandingCta } from '@/app/(landing)/landing-analytics'
|
||||
|
||||
const logger = createLogger('LandingTemplates')
|
||||
|
||||
@@ -297,6 +298,11 @@ export default function Templates() {
|
||||
})
|
||||
} finally {
|
||||
setIsPreparingTemplate(false)
|
||||
trackLandingCta({
|
||||
label: activeWorkflow.name,
|
||||
section: 'templates',
|
||||
destination: '/signup',
|
||||
})
|
||||
router.push('/signup')
|
||||
}
|
||||
}, [
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
'use client'
|
||||
|
||||
import { AuthModal } from '@/app/(landing)/components/auth-modal/auth-modal'
|
||||
import { trackLandingCta } from '@/app/(landing)/landing-analytics'
|
||||
|
||||
interface IntegrationCtaButtonProps {
|
||||
children: React.ReactNode
|
||||
className?: string
|
||||
label: string
|
||||
}
|
||||
|
||||
export function IntegrationCtaButton({ children, className, label }: IntegrationCtaButtonProps) {
|
||||
return (
|
||||
<AuthModal defaultView='signup' source='integrations'>
|
||||
<button
|
||||
type='button'
|
||||
className={className}
|
||||
onClick={() =>
|
||||
trackLandingCta({ label, section: 'integrations', destination: 'auth_modal' })
|
||||
}
|
||||
>
|
||||
{children}
|
||||
</button>
|
||||
</AuthModal>
|
||||
)
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
import { useRouter } from 'next/navigation'
|
||||
import { LandingPromptStorage } from '@/lib/core/utils/browser-storage'
|
||||
import { cn } from '@/lib/core/utils/cn'
|
||||
import { trackLandingCta } from '@/app/(landing)/landing-analytics'
|
||||
|
||||
interface TemplateCardButtonProps {
|
||||
prompt: string
|
||||
@@ -15,6 +16,7 @@ export function TemplateCardButton({ prompt, className, children }: TemplateCard
|
||||
|
||||
function handleClick() {
|
||||
LandingPromptStorage.store(prompt)
|
||||
trackLandingCta({ label: 'Template card', section: 'integrations', destination: '/signup' })
|
||||
router.push('/signup')
|
||||
}
|
||||
|
||||
|
||||
@@ -3,13 +3,14 @@ import Image from 'next/image'
|
||||
import Link from 'next/link'
|
||||
import { notFound } from 'next/navigation'
|
||||
import { getBaseUrl } from '@/lib/core/utils/urls'
|
||||
import { IntegrationCtaButton } from '@/app/(landing)/integrations/[slug]/components/integration-cta-button'
|
||||
import { IntegrationFAQ } from '@/app/(landing)/integrations/[slug]/components/integration-faq'
|
||||
import { TemplateCardButton } from '@/app/(landing)/integrations/[slug]/components/template-card-button'
|
||||
import { IntegrationIcon } from '@/app/(landing)/integrations/components/integration-icon'
|
||||
import { blockTypeToIconMap } from '@/app/(landing)/integrations/data/icon-mapping'
|
||||
import integrations from '@/app/(landing)/integrations/data/integrations.json'
|
||||
import type { AuthType, FAQItem, Integration } from '@/app/(landing)/integrations/data/types'
|
||||
import { TEMPLATES } from '@/app/workspace/[workspaceId]/home/components/template-prompts/consts'
|
||||
import { IntegrationIcon } from '../components/integration-icon'
|
||||
import { blockTypeToIconMap } from '../data/icon-mapping'
|
||||
import integrations from '../data/integrations.json'
|
||||
import type { AuthType, FAQItem, Integration } from '../data/types'
|
||||
import { IntegrationFAQ } from './components/integration-faq'
|
||||
import { TemplateCardButton } from './components/template-card-button'
|
||||
|
||||
const allIntegrations = integrations as Integration[]
|
||||
const INTEGRATION_COUNT = allIntegrations.length
|
||||
@@ -85,18 +86,18 @@ function buildFAQs(integration: Integration): FAQItem[] {
|
||||
const faqs: FAQItem[] = [
|
||||
{
|
||||
question: `What is Sim's ${name} integration?`,
|
||||
answer: `Sim's ${name} integration lets you build AI-powered workflows that automate tasks in ${name} without writing code. ${description} You can connect ${name} to hundreds of other services in the same workflow — from CRMs and spreadsheets to messaging tools and databases.`,
|
||||
answer: `Sim's ${name} integration lets you build AI agents that automate tasks in ${name} without writing code. ${description} You can connect ${name} to hundreds of other services in the same agent — from CRMs and spreadsheets to messaging tools and databases.`,
|
||||
},
|
||||
{
|
||||
question: `What can I automate with ${name} in Sim?`,
|
||||
answer:
|
||||
topOpNames.length > 0
|
||||
? `With Sim you can: ${topOpNames.join('; ')}${operations.length > 5 ? `; and ${operations.length - 5} more tools` : ''}. Each action runs inside an AI agent block, so you can combine ${name} with LLM reasoning, conditional logic, and data from any other connected service.`
|
||||
: `Sim lets you automate ${name} workflows by connecting it to an AI agent that can read from it, write to it, and chain it together with other services — all driven by natural-language instructions instead of rigid rules.`,
|
||||
: `Sim lets you automate ${name} by connecting it to an AI agent that can read from it, write to it, and chain it together with other services — all driven by natural-language instructions instead of rigid rules.`,
|
||||
},
|
||||
{
|
||||
question: `How do I connect ${name} to Sim?`,
|
||||
answer: `Getting started takes under five minutes: (1) Create a free account at sim.ai. (2) Open a new workflow. (3) Drag a ${name} block onto the canvas. (4) ${authStep} (5) Choose the tool you want to use, wire it to the inputs you need, and click Run. Your automation is live.`,
|
||||
answer: `Getting started takes under five minutes: (1) Create a free account at sim.ai. (2) Open your workspace and create an agent. (3) Drag a ${name} block onto the workflow builder. (4) ${authStep} (5) Choose the tool you want to use, wire it to the inputs you need, and click Run. Your agent is live.`,
|
||||
},
|
||||
{
|
||||
question: `Can I use ${name} as a tool inside an AI agent in Sim?`,
|
||||
@@ -106,19 +107,19 @@ function buildFAQs(integration: Integration): FAQItem[] {
|
||||
? [
|
||||
{
|
||||
question: `How do I ${topOpNames[0].toLowerCase()} with ${name} in Sim?`,
|
||||
answer: `Add a ${name} block to your workflow and select "${topOpNames[0]}" as the tool. Fill in the required fields — you can reference outputs from earlier steps, such as text generated by an AI agent or data fetched from another integration. No code is required.`,
|
||||
answer: `Add a ${name} block to your agent and select "${topOpNames[0]}" as the tool. Fill in the required fields — you can reference outputs from earlier steps, such as text generated by an AI agent or data fetched from another integration. No code is required.`,
|
||||
},
|
||||
]
|
||||
: []),
|
||||
...(triggers.length > 0
|
||||
? [
|
||||
{
|
||||
question: `How do I trigger a Sim workflow from ${name} automatically?`,
|
||||
answer: `Add a ${name} trigger block to your workflow and copy the generated webhook URL. Paste that URL into ${name}'s webhook settings and select the events you want to listen for (${triggers.map((t) => t.name).join(', ')}). From that point on, every matching event in ${name} instantly fires your workflow — no polling, no delay.`,
|
||||
question: `How do I trigger a Sim agent from ${name} automatically?`,
|
||||
answer: `Add a ${name} trigger block to your agent and copy the generated webhook URL. Paste that URL into ${name}'s webhook settings and select the events you want to listen for (${triggers.map((t) => t.name).join(', ')}). From that point on, every matching event in ${name} instantly runs your agent — no polling, no delay.`,
|
||||
},
|
||||
{
|
||||
question: `What data does Sim receive when a ${name} event triggers a workflow?`,
|
||||
answer: `When ${name} fires a webhook, Sim receives the full event payload that ${name} sends — typically the record or object that changed, along with metadata like the event type and timestamp. Inside your workflow, every field from that payload is available as a variable you can pass to AI agents, conditions, or other integrations.`,
|
||||
question: `What data does Sim receive when a ${name} event triggers an agent?`,
|
||||
answer: `When ${name} fires a webhook, Sim receives the full event payload that ${name} sends — typically the record or object that changed, along with metadata like the event type and timestamp. Inside your agent, every field from that payload is available as a variable you can pass to AI blocks, conditions, or other integrations.`,
|
||||
},
|
||||
]
|
||||
: []),
|
||||
@@ -156,7 +157,7 @@ export async function generateMetadata({
|
||||
.slice(0, 3)
|
||||
.map((o) => o.name)
|
||||
.join(', ')
|
||||
const metaDesc = `Automate ${name} with AI-powered workflows on Sim. ${description.slice(0, 100).trimEnd()}. Free to start.`
|
||||
const metaDesc = `Automate ${name} with AI agents in Sim. ${description.slice(0, 100).trimEnd()}. Free to start.`
|
||||
|
||||
return {
|
||||
title: `${name} Integration`,
|
||||
@@ -166,15 +167,15 @@ export async function generateMetadata({
|
||||
`${name} integration`,
|
||||
`automate ${name}`,
|
||||
`connect ${name}`,
|
||||
`${name} workflow`,
|
||||
`${name} AI agent`,
|
||||
`${name} AI automation`,
|
||||
...(opSample ? [`${name} ${opSample}`] : []),
|
||||
'workflow automation',
|
||||
'no-code automation',
|
||||
'AI agent workflow',
|
||||
'AI workspace integrations',
|
||||
'AI agent integrations',
|
||||
'AI agent builder',
|
||||
],
|
||||
openGraph: {
|
||||
title: `${name} Integration — AI Workflow Automation | Sim`,
|
||||
title: `${name} Integration | Sim AI Workspace`,
|
||||
description: `Connect ${name} to ${INTEGRATION_COUNT - 1}+ tools using AI agents. ${description.slice(0, 100).trimEnd()}.`,
|
||||
url: `${baseUrl}/integrations/${slug}`,
|
||||
type: 'website',
|
||||
@@ -190,7 +191,7 @@ export async function generateMetadata({
|
||||
twitter: {
|
||||
card: 'summary_large_image',
|
||||
title: `${name} Integration | Sim`,
|
||||
description: `Automate ${name} with AI-powered workflows. Connect to ${INTEGRATION_COUNT - 1}+ tools. Free to start.`,
|
||||
description: `Automate ${name} with AI agents in Sim. Connect to ${INTEGRATION_COUNT - 1}+ tools. Free to start.`,
|
||||
images: [{ url: `${baseUrl}/opengraph-image.png`, alt: `${name} Integration — Sim` }],
|
||||
},
|
||||
alternates: { canonical: `${baseUrl}/integrations/${slug}` },
|
||||
@@ -249,7 +250,7 @@ export default async function IntegrationPage({ params }: { params: Promise<{ sl
|
||||
'@context': 'https://schema.org',
|
||||
'@type': 'HowTo',
|
||||
name: `How to automate ${name} with Sim`,
|
||||
description: `Step-by-step guide to connecting ${name} to AI-powered workflows in Sim.`,
|
||||
description: `Step-by-step guide to connecting ${name} to AI agents in Sim.`,
|
||||
step: [
|
||||
{
|
||||
'@type': 'HowToStep',
|
||||
@@ -261,13 +262,13 @@ export default async function IntegrationPage({ params }: { params: Promise<{ sl
|
||||
'@type': 'HowToStep',
|
||||
position: 2,
|
||||
name: `Add a ${name} block`,
|
||||
text: `Open a workflow, drag a ${name} block onto the canvas, and authenticate with your ${name} credentials.`,
|
||||
text: `Open your workspace, drag a ${name} block onto the workflow builder, and authenticate with your ${name} credentials.`,
|
||||
},
|
||||
{
|
||||
'@type': 'HowToStep',
|
||||
position: 3,
|
||||
name: 'Configure and run',
|
||||
text: `Choose the operation you want, connect it to an AI agent, and run your workflow. Automate anything in ${name} without code.`,
|
||||
text: `Choose the operation you want, connect it to an AI agent, and deploy. Automate anything in ${name} without code.`,
|
||||
},
|
||||
],
|
||||
}
|
||||
@@ -366,12 +367,12 @@ export default async function IntegrationPage({ params }: { params: Promise<{ sl
|
||||
|
||||
{/* CTAs */}
|
||||
<div className='flex flex-wrap gap-2'>
|
||||
<Link
|
||||
href='/signup'
|
||||
<IntegrationCtaButton
|
||||
label='Start building free'
|
||||
className='inline-flex h-[32px] items-center gap-2 rounded-[5px] border border-white bg-white px-2.5 font-season text-black text-sm transition-colors hover:border-[#E0E0E0] hover:bg-[#E0E0E0]'
|
||||
>
|
||||
Start building free
|
||||
</Link>
|
||||
</IntegrationCtaButton>
|
||||
<a
|
||||
href={docsUrl}
|
||||
target='_blank'
|
||||
@@ -452,10 +453,10 @@ export default async function IntegrationPage({ params }: { params: Promise<{ sl
|
||||
title: `Add a ${name} block`,
|
||||
body:
|
||||
authType === 'oauth'
|
||||
? `Open a workflow, drag a ${name} block onto the canvas, and connect your account with one-click OAuth.`
|
||||
? `Open your workspace, drag a ${name} block onto the workflow builder, and connect your account with one-click OAuth.`
|
||||
: authType === 'api-key'
|
||||
? `Open a workflow, drag a ${name} block onto the canvas, and paste in your ${name} API key.`
|
||||
: `Open a workflow, drag a ${name} block onto the canvas, and authenticate your account.`,
|
||||
? `Open your workspace, drag a ${name} block onto the workflow builder, and paste in your ${name} API key.`
|
||||
: `Open your workspace, drag a ${name} block onto the workflow builder, and authenticate your account.`,
|
||||
},
|
||||
{
|
||||
step: '03',
|
||||
@@ -500,8 +501,8 @@ export default async function IntegrationPage({ params }: { params: Promise<{ sl
|
||||
</h2>
|
||||
</div>
|
||||
<p className='text-[14px] text-[var(--landing-text-body)] leading-[150%] tracking-[0.02em]'>
|
||||
Connect a {name} webhook to Sim and your workflow fires the instant an event happens
|
||||
— no polling, no delay.
|
||||
Connect a {name} webhook to Sim and your agent runs the instant an event happens —
|
||||
no polling, no delay.
|
||||
</p>
|
||||
</div>
|
||||
<div className='h-px w-full bg-[var(--landing-bg-elevated)]' />
|
||||
@@ -533,10 +534,10 @@ export default async function IntegrationPage({ params }: { params: Promise<{ sl
|
||||
id='templates-heading'
|
||||
className='mb-2 text-[20px] text-white leading-[100%] tracking-[-0.02em]'
|
||||
>
|
||||
Workflow templates
|
||||
Agent templates
|
||||
</h2>
|
||||
<p className='text-[14px] text-[var(--landing-text-body)] tracking-[0.02em]'>
|
||||
Ready-to-use workflows featuring {name}. Click any to build it instantly.
|
||||
Ready-to-use templates featuring {name}. Click any to build it instantly.
|
||||
</p>
|
||||
</div>
|
||||
<div className='h-px w-full bg-[var(--landing-bg-elevated)]' />
|
||||
@@ -775,15 +776,15 @@ export default async function IntegrationPage({ params }: { params: Promise<{ sl
|
||||
Start automating {name} today
|
||||
</h2>
|
||||
<p className='mx-auto mb-8 max-w-[480px] text-[var(--landing-text-body)] text-base leading-[150%] tracking-[0.02em]'>
|
||||
Build your first AI workflow with {name} in minutes. Connect to every tool your team
|
||||
uses. Free to start — no credit card required.
|
||||
Build your first AI agent with {name} in minutes. Connect to every tool your team uses.
|
||||
Free to start — no credit card required.
|
||||
</p>
|
||||
<Link
|
||||
href='/signup'
|
||||
<IntegrationCtaButton
|
||||
label='Build for free'
|
||||
className='inline-flex h-[32px] items-center gap-2 rounded-[5px] border border-white bg-white px-2.5 font-season text-black text-sm transition-colors hover:border-[#E0E0E0] hover:bg-[#E0E0E0]'
|
||||
>
|
||||
Build for free
|
||||
</Link>
|
||||
</IntegrationCtaButton>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -30,17 +30,17 @@ const featured = FEATURED_SLUGS.map((s) => bySlug.get(s)).filter(
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'Integrations',
|
||||
description: `Connect ${INTEGRATION_COUNT}+ apps and services with Sim's AI workflow automation. Build intelligent pipelines with ${TOP_NAMES.join(', ')}, and more.`,
|
||||
description: `Connect ${INTEGRATION_COUNT}+ apps and services in Sim's AI workspace. Build agents that automate real work with ${TOP_NAMES.join(', ')}, and more.`,
|
||||
keywords: [
|
||||
'workflow automation integrations',
|
||||
'AI workflow automation',
|
||||
'no-code automation',
|
||||
'AI workspace integrations',
|
||||
'AI agent integrations',
|
||||
'AI agent builder integrations',
|
||||
...TOP_NAMES.flatMap((n) => [`${n} integration`, `${n} automation`]),
|
||||
...allIntegrations.slice(0, 20).map((i) => `${i.name} automation`),
|
||||
],
|
||||
openGraph: {
|
||||
title: 'Integrations for AI Workflow Automation | Sim',
|
||||
description: `Connect ${INTEGRATION_COUNT}+ apps with Sim. Build AI-powered pipelines that link ${TOP_NAMES.join(', ')}, and every tool your team uses.`,
|
||||
title: 'Integrations | Sim AI Workspace',
|
||||
description: `Connect ${INTEGRATION_COUNT}+ apps in Sim's AI workspace. Build agents that link ${TOP_NAMES.join(', ')}, and every tool your team uses.`,
|
||||
url: `${baseUrl}/integrations`,
|
||||
type: 'website',
|
||||
images: [
|
||||
@@ -55,7 +55,7 @@ export const metadata: Metadata = {
|
||||
twitter: {
|
||||
card: 'summary_large_image',
|
||||
title: 'Integrations | Sim',
|
||||
description: `Connect ${INTEGRATION_COUNT}+ apps with Sim's AI workflow automation.`,
|
||||
description: `Connect ${INTEGRATION_COUNT}+ apps in Sim's AI workspace.`,
|
||||
images: [
|
||||
{ url: `${baseUrl}/opengraph-image.png`, alt: 'Sim Integrations for AI Workflow Automation' },
|
||||
],
|
||||
@@ -82,7 +82,7 @@ export default function IntegrationsPage() {
|
||||
'@context': 'https://schema.org',
|
||||
'@type': 'ItemList',
|
||||
name: 'Sim AI Workflow Integrations',
|
||||
description: `Complete list of ${INTEGRATION_COUNT}+ integrations available in Sim for building AI-powered workflow automation.`,
|
||||
description: `Complete list of ${INTEGRATION_COUNT}+ integrations available in Sim's AI workspace for building and deploying AI agents.`,
|
||||
url: `${baseUrl}/integrations`,
|
||||
numberOfItems: INTEGRATION_COUNT,
|
||||
itemListElement: allIntegrations.map((integration, index) => ({
|
||||
@@ -129,7 +129,7 @@ export default function IntegrationsPage() {
|
||||
Integrations
|
||||
</h1>
|
||||
<p className='font-[430] font-season text-[var(--landing-text-muted)] text-sm leading-[150%] tracking-[0.02em] lg:text-base'>
|
||||
Connect every tool your team uses. Build AI-powered workflows that automate tasks across{' '}
|
||||
Connect every tool your team uses. Build agents that automate real work across{' '}
|
||||
{INTEGRATION_COUNT} apps and services.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
'use client'
|
||||
|
||||
import { useEffect } from 'react'
|
||||
import { usePostHog } from 'posthog-js/react'
|
||||
import { captureClientEvent, captureEvent } from '@/lib/posthog/client'
|
||||
import { captureClientEvent } from '@/lib/posthog/client'
|
||||
import type { PostHogEventMap } from '@/lib/posthog/events'
|
||||
|
||||
export function LandingAnalytics() {
|
||||
const posthog = usePostHog()
|
||||
|
||||
useEffect(() => {
|
||||
captureEvent(posthog, 'landing_page_viewed', {})
|
||||
}, [posthog])
|
||||
captureClientEvent('landing_page_viewed', {})
|
||||
}, [])
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ import { martianMono } from '@/app/_styles/fonts/martian-mono/martian-mono'
|
||||
import { season } from '@/app/_styles/fonts/season/season'
|
||||
import {
|
||||
Collaboration,
|
||||
// Enterprise,
|
||||
Features,
|
||||
Footer,
|
||||
Hero,
|
||||
@@ -31,7 +30,7 @@ import { LandingAnalytics } from '@/app/(landing)/landing-analytics'
|
||||
* - Section `id` attributes serve as fragment anchors for precise AI citations.
|
||||
* - Content ordering prioritizes answer-first patterns: definition (Hero) ->
|
||||
* examples (Templates) -> capabilities (Features) -> social proof (Collaboration) ->
|
||||
* enterprise (Enterprise) -> pricing (Pricing) -> testimonials (Testimonials).
|
||||
* pricing (Pricing) -> testimonials (Testimonials).
|
||||
*/
|
||||
export default async function Landing() {
|
||||
const blogPosts = await getNavBlogPosts()
|
||||
@@ -53,16 +52,18 @@ export default async function Landing() {
|
||||
</header>
|
||||
<main id='main-content'>
|
||||
<article itemScope itemType='https://schema.org/WebPage'>
|
||||
<meta itemProp='name' content='Sim — Build AI Agents & Run Your Agentic Workforce' />
|
||||
<meta
|
||||
itemProp='name'
|
||||
content='Sim — The AI Workspace | Build, Deploy & Manage AI Agents'
|
||||
/>
|
||||
<meta
|
||||
itemProp='description'
|
||||
content='Sim is the open-source platform to build AI agents and run your agentic workforce.'
|
||||
content='Sim is the open-source AI workspace where teams build, deploy, and manage AI agents.'
|
||||
/>
|
||||
<Hero />
|
||||
<Templates />
|
||||
<Features />
|
||||
<Collaboration />
|
||||
{/* <Enterprise /> */}
|
||||
<Pricing />
|
||||
<Testimonials />
|
||||
</article>
|
||||
|
||||
@@ -42,17 +42,18 @@ const faqItems = [
|
||||
'Tool use — also called function calling — lets an agent invoke external APIs, query databases, run code, or take any action you define. In Sim, all first-party models from OpenAI, Anthropic, Google, Mistral, Groq, Cerebras, and xAI support tool use. Look for the Tool Use capability tag on any model card in this directory to confirm support.',
|
||||
},
|
||||
{
|
||||
question: 'How do I add a model to a Sim agent workflow?',
|
||||
question: 'How do I add a model to a Sim agent?',
|
||||
answer:
|
||||
'Open any workflow in Sim, add an Agent block, and select your provider and model from the model picker inside that block. Every model listed in this directory is available in the Agent block. Swapping models takes one click and does not affect the rest of your workflow, making it straightforward to test different models on the same task without rebuilding anything.',
|
||||
'Open Sim, add an Agent block, and select your provider and model from the model picker inside that block. Every model listed in this directory is available in the Agent block. Swapping models takes one click and does not affect the rest of your agent, making it straightforward to test different models on the same task without rebuilding anything.',
|
||||
},
|
||||
]
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'AI Models Directory',
|
||||
description: `Browse ${TOTAL_MODELS}+ AI models across ${TOTAL_MODEL_PROVIDERS} providers. Compare pricing, context windows, and capabilities for OpenAI, Anthropic, Google, xAI, Mistral, Bedrock, Groq, and more.`,
|
||||
description: `Browse and compare ${TOTAL_MODELS}+ AI models across ${TOTAL_MODEL_PROVIDERS} providers in Sim's AI workspace. Compare pricing, context windows, and capabilities — then use any model directly in your agents.`,
|
||||
keywords: [
|
||||
'AI models directory',
|
||||
'AI model comparison',
|
||||
'LLM model list',
|
||||
'model pricing',
|
||||
'context window comparison',
|
||||
@@ -185,7 +186,7 @@ export default function ModelsPage() {
|
||||
id='models-heading'
|
||||
className='text-balance text-[28px] text-white leading-[100%] tracking-[-0.02em] lg:text-[40px]'
|
||||
>
|
||||
Models
|
||||
Compare AI Models
|
||||
</h1>
|
||||
<p className='font-[430] font-season text-[var(--landing-text-muted)] text-sm leading-[150%] tracking-[0.02em] lg:text-base'>
|
||||
Browse {TOTAL_MODELS} AI models across {TOTAL_MODEL_PROVIDERS} providers. Compare
|
||||
|
||||
@@ -695,7 +695,7 @@ export function buildModelFaqs(provider: CatalogProvider, model: CatalogModel):
|
||||
{
|
||||
question: `What is the context window for ${model.displayName}?`,
|
||||
answer: model.contextWindow
|
||||
? `${model.displayName} supports a context window of ${formatTokenCount(model.contextWindow)} tokens in Sim. In an agent workflow, this determines how much conversation history, tool outputs, and retrieved documents the model can hold in a single call.`
|
||||
? `${model.displayName} supports a context window of ${formatTokenCount(model.contextWindow)} tokens in Sim. In an agent, this determines how much conversation history, tool outputs, and retrieved documents the model can hold in a single call.`
|
||||
: `A public context window value is not currently tracked for ${model.displayName}.`,
|
||||
},
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ import Navbar from '@/app/(landing)/components/navbar/navbar'
|
||||
export const metadata: Metadata = {
|
||||
title: 'Partner Program',
|
||||
description:
|
||||
'Join the Sim partner program. Build, deploy, and sell AI workflow solutions. Earn your certification through Sim Academy.',
|
||||
"Join the Sim partner program. Build, deploy, and sell AI agent solutions powered by Sim's AI workspace. Earn your certification through Sim Academy.",
|
||||
metadataBase: new URL('https://sim.ai'),
|
||||
openGraph: {
|
||||
title: 'Partner Program | Sim',
|
||||
@@ -22,7 +22,7 @@ const PARTNER_TIERS = [
|
||||
name: 'Certified Partner',
|
||||
badge: 'Entry',
|
||||
color: '#3A3A3A',
|
||||
requirements: ['Complete Sim Academy certification', 'Deploy at least 1 live workflow'],
|
||||
requirements: ['Complete Sim Academy certification', 'Deploy at least 1 live agent'],
|
||||
perks: [
|
||||
'Official partner badge',
|
||||
'Listed in partner directory',
|
||||
@@ -69,13 +69,13 @@ const HOW_IT_WORKS = [
|
||||
step: '01',
|
||||
title: 'Sign up & complete Sim Academy',
|
||||
description:
|
||||
'Create an account and work through the Sim Academy certification program. Learn to build, integrate, and deploy AI workflows through hands-on canvas exercises.',
|
||||
'Create an account and work through the Sim Academy certification program. Learn to build, integrate, and deploy AI agents through hands-on exercises.',
|
||||
},
|
||||
{
|
||||
step: '02',
|
||||
title: 'Build & deploy real solutions',
|
||||
description:
|
||||
'Put your skills to work. Build workflow automations for clients, integrate Sim into existing products, or create your own Sim-powered applications.',
|
||||
'Put your skills to work. Build AI agents for clients, integrate Sim into existing products, or create your own Sim-powered applications.',
|
||||
},
|
||||
{
|
||||
step: '03',
|
||||
@@ -119,7 +119,7 @@ const BENEFITS = [
|
||||
icon: '📣',
|
||||
title: 'Community',
|
||||
description:
|
||||
'Join a growing community of Sim builders. Share workflows, collaborate on solutions, and shape the product roadmap.',
|
||||
'Join a growing community of Sim builders. Share agents, collaborate on solutions, and shape the product roadmap.',
|
||||
},
|
||||
]
|
||||
|
||||
@@ -144,11 +144,11 @@ export default async function PartnersPage() {
|
||||
<h1 className='mb-5 text-[64px] text-white leading-[105%] tracking-[-0.03em]'>
|
||||
Build the future
|
||||
<br />
|
||||
of AI automation
|
||||
of AI agents
|
||||
</h1>
|
||||
<p className='mb-10 max-w-xl text-[#F6F6F0]/60 text-[18px] leading-[160%] tracking-[0.01em]'>
|
||||
Become a certified Sim partner. Complete Sim Academy, deploy real solutions, and earn
|
||||
recognition in the growing ecosystem of AI workflow builders.
|
||||
recognition in the growing ecosystem of AI agent builders.
|
||||
</p>
|
||||
<div className='flex items-center gap-4'>
|
||||
{/* TODO: Uncomment when academy is public */}
|
||||
|
||||
71
apps/sim/app/api/audit-logs/route.ts
Normal file
71
apps/sim/app/api/audit-logs/route.ts
Normal file
@@ -0,0 +1,71 @@
|
||||
import { createLogger } from '@sim/logger'
|
||||
import { NextResponse } from 'next/server'
|
||||
import { getSession } from '@/lib/auth'
|
||||
import { validateEnterpriseAuditAccess } from '@/app/api/v1/audit-logs/auth'
|
||||
import { formatAuditLogEntry } from '@/app/api/v1/audit-logs/format'
|
||||
import {
|
||||
buildFilterConditions,
|
||||
buildOrgScopeCondition,
|
||||
queryAuditLogs,
|
||||
} from '@/app/api/v1/audit-logs/query'
|
||||
|
||||
const logger = createLogger('AuditLogsAPI')
|
||||
|
||||
export const dynamic = 'force-dynamic'
|
||||
|
||||
export async function GET(request: Request) {
|
||||
try {
|
||||
const session = await getSession()
|
||||
if (!session?.user?.id) {
|
||||
return NextResponse.json({ error: 'Unauthorized' }, { status: 401 })
|
||||
}
|
||||
|
||||
const authResult = await validateEnterpriseAuditAccess(session.user.id)
|
||||
if (!authResult.success) {
|
||||
return authResult.response
|
||||
}
|
||||
|
||||
const { orgMemberIds } = authResult.context
|
||||
|
||||
const { searchParams } = new URL(request.url)
|
||||
const search = searchParams.get('search')?.trim() || undefined
|
||||
const startDate = searchParams.get('startDate') || undefined
|
||||
const endDate = searchParams.get('endDate') || undefined
|
||||
const includeDeparted = searchParams.get('includeDeparted') === 'true'
|
||||
const limit = Math.min(Math.max(Number(searchParams.get('limit')) || 50, 1), 100)
|
||||
const cursor = searchParams.get('cursor') || undefined
|
||||
|
||||
if (startDate && Number.isNaN(Date.parse(startDate))) {
|
||||
return NextResponse.json({ error: 'Invalid startDate format' }, { status: 400 })
|
||||
}
|
||||
if (endDate && Number.isNaN(Date.parse(endDate))) {
|
||||
return NextResponse.json({ error: 'Invalid endDate format' }, { status: 400 })
|
||||
}
|
||||
|
||||
const scopeCondition = await buildOrgScopeCondition(orgMemberIds, includeDeparted)
|
||||
const filterConditions = buildFilterConditions({
|
||||
action: searchParams.get('action') || undefined,
|
||||
resourceType: searchParams.get('resourceType') || undefined,
|
||||
actorId: searchParams.get('actorId') || undefined,
|
||||
search,
|
||||
startDate,
|
||||
endDate,
|
||||
})
|
||||
|
||||
const { data, nextCursor } = await queryAuditLogs(
|
||||
[scopeCondition, ...filterConditions],
|
||||
limit,
|
||||
cursor
|
||||
)
|
||||
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
data: data.map(formatAuditLogEntry),
|
||||
nextCursor,
|
||||
})
|
||||
} catch (error: unknown) {
|
||||
const message = error instanceof Error ? error.message : 'Unknown error'
|
||||
logger.error('Audit logs fetch error', { error: message })
|
||||
return NextResponse.json({ error: 'Internal server error' }, { status: 500 })
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,10 @@
|
||||
import { db } from '@sim/db'
|
||||
import { user } from '@sim/db/schema'
|
||||
import { createLogger } from '@sim/logger'
|
||||
import { eq } from 'drizzle-orm'
|
||||
import { type NextRequest, NextResponse } from 'next/server'
|
||||
import { z } from 'zod'
|
||||
import { AuditAction, AuditResourceType, recordAudit } from '@/lib/audit/log'
|
||||
import { auth } from '@/lib/auth'
|
||||
import { isSameOrigin } from '@/lib/core/utils/validation'
|
||||
|
||||
@@ -51,6 +55,26 @@ export async function POST(request: NextRequest) {
|
||||
method: 'POST',
|
||||
})
|
||||
|
||||
const [existingUser] = await db
|
||||
.select({ id: user.id, name: user.name, email: user.email })
|
||||
.from(user)
|
||||
.where(eq(user.email, email))
|
||||
.limit(1)
|
||||
|
||||
if (existingUser) {
|
||||
recordAudit({
|
||||
actorId: existingUser.id,
|
||||
actorName: existingUser.name,
|
||||
actorEmail: existingUser.email,
|
||||
action: AuditAction.PASSWORD_RESET_REQUESTED,
|
||||
resourceType: AuditResourceType.PASSWORD,
|
||||
resourceId: existingUser.id,
|
||||
resourceName: existingUser.email ?? undefined,
|
||||
description: `Password reset requested for ${existingUser.email}`,
|
||||
request,
|
||||
})
|
||||
}
|
||||
|
||||
return NextResponse.json({ success: true })
|
||||
} catch (error) {
|
||||
logger.error('Error requesting password reset:', { error })
|
||||
|
||||
14
apps/sim/app/api/auth/providers/route.ts
Normal file
14
apps/sim/app/api/auth/providers/route.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { NextResponse } from 'next/server'
|
||||
import { isRegistrationDisabled } from '@/lib/core/config/feature-flags'
|
||||
import { getOAuthProviderStatus } from '@/app/(auth)/components/oauth-provider-checker'
|
||||
|
||||
export const dynamic = 'force-dynamic'
|
||||
|
||||
export async function GET() {
|
||||
const { githubAvailable, googleAvailable } = await getOAuthProviderStatus()
|
||||
return NextResponse.json({
|
||||
githubAvailable,
|
||||
googleAvailable,
|
||||
registrationDisabled: isRegistrationDisabled,
|
||||
})
|
||||
}
|
||||
@@ -64,8 +64,12 @@ export async function POST(request: NextRequest) {
|
||||
actorEmail: session.user.email,
|
||||
action: AuditAction.CREDIT_PURCHASED,
|
||||
resourceType: AuditResourceType.BILLING,
|
||||
resourceId: validation.data.requestId,
|
||||
description: `Purchased $${validation.data.amount} in credits`,
|
||||
metadata: { amount: validation.data.amount, requestId: validation.data.requestId },
|
||||
metadata: {
|
||||
amountDollars: validation.data.amount,
|
||||
requestId: validation.data.requestId,
|
||||
},
|
||||
request,
|
||||
})
|
||||
|
||||
|
||||
@@ -233,6 +233,12 @@ export async function PATCH(request: NextRequest, { params }: { params: Promise<
|
||||
resourceId: chatId,
|
||||
resourceName: title || existingChatRecord.title,
|
||||
description: `Updated chat deployment "${title || existingChatRecord.title}"`,
|
||||
metadata: {
|
||||
identifier: updatedIdentifier,
|
||||
authType: updateData.authType || existingChatRecord.authType,
|
||||
workflowId: workflowId || existingChatRecord.workflowId,
|
||||
chatUrl,
|
||||
},
|
||||
request,
|
||||
})
|
||||
|
||||
|
||||
@@ -159,7 +159,12 @@ export async function POST(
|
||||
resourceId: id,
|
||||
resourceName: result.set.name,
|
||||
description: `Resent credential set invitation to ${invitation.email}`,
|
||||
metadata: { invitationId, targetEmail: invitation.email },
|
||||
metadata: {
|
||||
invitationId,
|
||||
targetEmail: invitation.email,
|
||||
providerId: result.set.providerId,
|
||||
credentialSetName: result.set.name,
|
||||
},
|
||||
request: req,
|
||||
})
|
||||
|
||||
|
||||
@@ -187,7 +187,12 @@ export async function POST(req: NextRequest, { params }: { params: Promise<{ id:
|
||||
actorEmail: session.user.email ?? undefined,
|
||||
resourceName: result.set.name,
|
||||
description: `Created invitation for credential set "${result.set.name}"${email ? ` to ${email}` : ''}`,
|
||||
metadata: { targetEmail: email || undefined },
|
||||
metadata: {
|
||||
invitationId: invitation.id,
|
||||
targetEmail: email || undefined,
|
||||
providerId: result.set.providerId,
|
||||
credentialSetName: result.set.name,
|
||||
},
|
||||
request: req,
|
||||
})
|
||||
|
||||
|
||||
@@ -197,7 +197,12 @@ export async function DELETE(req: NextRequest, { params }: { params: Promise<{ i
|
||||
actorEmail: session.user.email ?? undefined,
|
||||
resourceName: result.set.name,
|
||||
description: `Removed member from credential set "${result.set.name}"`,
|
||||
metadata: { targetEmail: memberToRemove.email ?? undefined },
|
||||
metadata: {
|
||||
memberId,
|
||||
memberUserId: memberToRemove.userId,
|
||||
targetEmail: memberToRemove.email ?? undefined,
|
||||
providerId: result.set.providerId,
|
||||
},
|
||||
request: req,
|
||||
})
|
||||
|
||||
|
||||
@@ -142,6 +142,13 @@ export async function PUT(req: NextRequest, { params }: { params: Promise<{ id:
|
||||
actorEmail: session.user.email ?? undefined,
|
||||
resourceName: updated?.name ?? result.set.name,
|
||||
description: `Updated credential set "${updated?.name ?? result.set.name}"`,
|
||||
metadata: {
|
||||
organizationId: result.set.organizationId,
|
||||
providerId: result.set.providerId,
|
||||
updatedFields: Object.keys(updates).filter(
|
||||
(k) => updates[k as keyof typeof updates] !== undefined
|
||||
),
|
||||
},
|
||||
request: req,
|
||||
})
|
||||
|
||||
@@ -199,6 +206,7 @@ export async function DELETE(req: NextRequest, { params }: { params: Promise<{ i
|
||||
actorEmail: session.user.email ?? undefined,
|
||||
resourceName: result.set.name,
|
||||
description: `Deleted credential set "${result.set.name}"`,
|
||||
metadata: { organizationId: result.set.organizationId, providerId: result.set.providerId },
|
||||
request: req,
|
||||
})
|
||||
|
||||
|
||||
@@ -192,7 +192,12 @@ export async function POST(req: NextRequest, { params }: { params: Promise<{ tok
|
||||
resourceId: invitation.credentialSetId,
|
||||
resourceName: invitation.credentialSetName,
|
||||
description: `Accepted credential set invitation`,
|
||||
metadata: { invitationId: invitation.id },
|
||||
metadata: {
|
||||
invitationId: invitation.id,
|
||||
credentialSetId: invitation.credentialSetId,
|
||||
providerId: invitation.providerId,
|
||||
credentialSetName: invitation.credentialSetName,
|
||||
},
|
||||
request: req,
|
||||
})
|
||||
|
||||
|
||||
@@ -116,6 +116,7 @@ export async function DELETE(req: NextRequest) {
|
||||
resourceType: AuditResourceType.CREDENTIAL_SET,
|
||||
resourceId: credentialSetId,
|
||||
description: `Left credential set`,
|
||||
metadata: { credentialSetId },
|
||||
request: req,
|
||||
})
|
||||
|
||||
|
||||
@@ -179,6 +179,7 @@ export async function POST(req: Request) {
|
||||
actorEmail: session.user.email ?? undefined,
|
||||
resourceName: name,
|
||||
description: `Created credential set "${name}"`,
|
||||
metadata: { organizationId, providerId, credentialSetName: name },
|
||||
request: req,
|
||||
})
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import { createLogger } from '@sim/logger'
|
||||
import { and, eq } from 'drizzle-orm'
|
||||
import { type NextRequest, NextResponse } from 'next/server'
|
||||
import { z } from 'zod'
|
||||
import { AuditAction, AuditResourceType, recordAudit } from '@/lib/audit/log'
|
||||
import { getSession } from '@/lib/auth'
|
||||
import { encryptSecret } from '@/lib/core/security/encryption'
|
||||
import { generateId } from '@/lib/core/utils/uuid'
|
||||
@@ -166,6 +167,23 @@ export async function PUT(request: NextRequest, { params }: { params: Promise<{
|
||||
updates.updatedAt = new Date()
|
||||
await db.update(credential).set(updates).where(eq(credential.id, id))
|
||||
|
||||
recordAudit({
|
||||
workspaceId: access.credential.workspaceId,
|
||||
actorId: session.user.id,
|
||||
actorName: session.user.name,
|
||||
actorEmail: session.user.email,
|
||||
action: AuditAction.CREDENTIAL_UPDATED,
|
||||
resourceType: AuditResourceType.CREDENTIAL,
|
||||
resourceId: id,
|
||||
resourceName: access.credential.displayName,
|
||||
description: `Updated ${access.credential.type} credential "${access.credential.displayName}"`,
|
||||
metadata: {
|
||||
credentialType: access.credential.type,
|
||||
updatedFields: Object.keys(updates).filter((k) => k !== 'updatedAt'),
|
||||
},
|
||||
request,
|
||||
})
|
||||
|
||||
const row = await getCredentialResponse(id, session.user.id)
|
||||
return NextResponse.json({ credential: row }, { status: 200 })
|
||||
} catch (error) {
|
||||
@@ -249,6 +267,20 @@ export async function DELETE(
|
||||
{ groups: { workspace: access.credential.workspaceId } }
|
||||
)
|
||||
|
||||
recordAudit({
|
||||
workspaceId: access.credential.workspaceId,
|
||||
actorId: session.user.id,
|
||||
actorName: session.user.name,
|
||||
actorEmail: session.user.email,
|
||||
action: AuditAction.CREDENTIAL_DELETED,
|
||||
resourceType: AuditResourceType.CREDENTIAL,
|
||||
resourceId: id,
|
||||
resourceName: access.credential.displayName,
|
||||
description: `Deleted personal env credential "${access.credential.envKey}"`,
|
||||
metadata: { credentialType: 'env_personal', envKey: access.credential.envKey },
|
||||
request,
|
||||
})
|
||||
|
||||
return NextResponse.json({ success: true }, { status: 200 })
|
||||
}
|
||||
|
||||
@@ -302,6 +334,20 @@ export async function DELETE(
|
||||
{ groups: { workspace: access.credential.workspaceId } }
|
||||
)
|
||||
|
||||
recordAudit({
|
||||
workspaceId: access.credential.workspaceId,
|
||||
actorId: session.user.id,
|
||||
actorName: session.user.name,
|
||||
actorEmail: session.user.email,
|
||||
action: AuditAction.CREDENTIAL_DELETED,
|
||||
resourceType: AuditResourceType.CREDENTIAL,
|
||||
resourceId: id,
|
||||
resourceName: access.credential.displayName,
|
||||
description: `Deleted workspace env credential "${access.credential.envKey}"`,
|
||||
metadata: { credentialType: 'env_workspace', envKey: access.credential.envKey },
|
||||
request,
|
||||
})
|
||||
|
||||
return NextResponse.json({ success: true }, { status: 200 })
|
||||
}
|
||||
|
||||
@@ -318,6 +364,23 @@ export async function DELETE(
|
||||
{ groups: { workspace: access.credential.workspaceId } }
|
||||
)
|
||||
|
||||
recordAudit({
|
||||
workspaceId: access.credential.workspaceId,
|
||||
actorId: session.user.id,
|
||||
actorName: session.user.name,
|
||||
actorEmail: session.user.email,
|
||||
action: AuditAction.CREDENTIAL_DELETED,
|
||||
resourceType: AuditResourceType.CREDENTIAL,
|
||||
resourceId: id,
|
||||
resourceName: access.credential.displayName,
|
||||
description: `Deleted ${access.credential.type} credential "${access.credential.displayName}"`,
|
||||
metadata: {
|
||||
credentialType: access.credential.type,
|
||||
providerId: access.credential.providerId,
|
||||
},
|
||||
request,
|
||||
})
|
||||
|
||||
return NextResponse.json({ success: true }, { status: 200 })
|
||||
} catch (error) {
|
||||
logger.error('Failed to delete credential', error)
|
||||
|
||||
@@ -4,6 +4,7 @@ import { createLogger } from '@sim/logger'
|
||||
import { and, eq } from 'drizzle-orm'
|
||||
import { type NextRequest, NextResponse } from 'next/server'
|
||||
import { z } from 'zod'
|
||||
import { AuditAction, AuditResourceType, recordAudit } from '@/lib/audit/log'
|
||||
import { getSession } from '@/lib/auth'
|
||||
import { encryptSecret } from '@/lib/core/security/encryption'
|
||||
import { generateRequestId } from '@/lib/core/utils/request'
|
||||
@@ -612,6 +613,23 @@ export async function POST(request: NextRequest) {
|
||||
}
|
||||
)
|
||||
|
||||
recordAudit({
|
||||
workspaceId,
|
||||
actorId: session.user.id,
|
||||
actorName: session.user.name,
|
||||
actorEmail: session.user.email,
|
||||
action: AuditAction.CREDENTIAL_CREATED,
|
||||
resourceType: AuditResourceType.CREDENTIAL,
|
||||
resourceId: credentialId,
|
||||
resourceName: resolvedDisplayName,
|
||||
description: `Created ${type} credential "${resolvedDisplayName}"`,
|
||||
metadata: {
|
||||
credentialType: type,
|
||||
providerId: resolvedProviderId,
|
||||
},
|
||||
request,
|
||||
})
|
||||
|
||||
return NextResponse.json({ credential: created }, { status: 201 })
|
||||
} catch (error: any) {
|
||||
if (error?.code === '23505') {
|
||||
|
||||
@@ -67,8 +67,13 @@ export async function POST(req: NextRequest) {
|
||||
actorEmail: session.user.email,
|
||||
action: AuditAction.ENVIRONMENT_UPDATED,
|
||||
resourceType: AuditResourceType.ENVIRONMENT,
|
||||
description: 'Updated global environment variables',
|
||||
metadata: { variableCount: Object.keys(variables).length },
|
||||
resourceId: session.user.id,
|
||||
description: `Updated ${Object.keys(variables).length} personal environment variable(s)`,
|
||||
metadata: {
|
||||
variableCount: Object.keys(variables).length,
|
||||
updatedKeys: Object.keys(variables),
|
||||
scope: 'personal',
|
||||
},
|
||||
request: req,
|
||||
})
|
||||
|
||||
|
||||
@@ -168,7 +168,13 @@ export async function POST(request: NextRequest) {
|
||||
resourceId: id,
|
||||
resourceName: name.trim(),
|
||||
description: `Created folder "${name.trim()}"`,
|
||||
metadata: { name: name.trim() },
|
||||
metadata: {
|
||||
name: name.trim(),
|
||||
workspaceId,
|
||||
parentId: parentId || undefined,
|
||||
color: color || '#6B7280',
|
||||
sortOrder: newFolder.sortOrder,
|
||||
},
|
||||
request,
|
||||
})
|
||||
|
||||
|
||||
@@ -197,8 +197,14 @@ export async function PATCH(request: NextRequest, { params }: { params: Promise<
|
||||
resourceId: id,
|
||||
actorName: session.user.name ?? undefined,
|
||||
actorEmail: session.user.email ?? undefined,
|
||||
resourceName: formRecord.title ?? undefined,
|
||||
description: `Updated form "${formRecord.title}"`,
|
||||
resourceName: (title || formRecord.title) ?? undefined,
|
||||
description: `Updated form "${title || formRecord.title}"`,
|
||||
metadata: {
|
||||
identifier: identifier || formRecord.identifier,
|
||||
workflowId: formRecord.workflowId,
|
||||
authType: authType || formRecord.authType,
|
||||
updatedFields: Object.keys(updateData).filter((k) => k !== 'updatedAt'),
|
||||
},
|
||||
request,
|
||||
})
|
||||
|
||||
@@ -255,6 +261,7 @@ export async function DELETE(
|
||||
actorEmail: session.user.email ?? undefined,
|
||||
resourceName: formRecord.title ?? undefined,
|
||||
description: `Deleted form "${formRecord.title}"`,
|
||||
metadata: { identifier: formRecord.identifier, workflowId: formRecord.workflowId },
|
||||
request,
|
||||
})
|
||||
|
||||
|
||||
@@ -208,6 +208,7 @@ export async function POST(request: NextRequest) {
|
||||
actorEmail: session.user.email ?? undefined,
|
||||
resourceName: title,
|
||||
description: `Created form "${title}" for workflow ${workflowId}`,
|
||||
metadata: { identifier, workflowId, authType, formUrl, showBranding },
|
||||
request,
|
||||
})
|
||||
|
||||
|
||||
@@ -194,7 +194,13 @@ export async function PATCH(request: NextRequest, { params }: RouteParams) {
|
||||
resourceType: AuditResourceType.CONNECTOR,
|
||||
resourceId: connectorId,
|
||||
description: `Restored ${updated.length} excluded document(s) for knowledge base "${writeCheck.knowledgeBase.name}"`,
|
||||
metadata: { knowledgeBaseId, documentCount: updated.length },
|
||||
metadata: {
|
||||
knowledgeBaseId,
|
||||
knowledgeBaseName: writeCheck.knowledgeBase.name,
|
||||
operation: 'restore',
|
||||
documentCount: updated.length,
|
||||
documentIds: updated.map((d) => d.id),
|
||||
},
|
||||
request,
|
||||
})
|
||||
|
||||
@@ -229,7 +235,13 @@ export async function PATCH(request: NextRequest, { params }: RouteParams) {
|
||||
resourceType: AuditResourceType.CONNECTOR,
|
||||
resourceId: connectorId,
|
||||
description: `Excluded ${updated.length} document(s) from knowledge base "${writeCheck.knowledgeBase.name}"`,
|
||||
metadata: { knowledgeBaseId, documentCount: updated.length },
|
||||
metadata: {
|
||||
knowledgeBaseId,
|
||||
knowledgeBaseName: writeCheck.knowledgeBase.name,
|
||||
operation: 'exclude',
|
||||
documentCount: updated.length,
|
||||
documentIds: updated.map((d) => d.id),
|
||||
},
|
||||
request,
|
||||
})
|
||||
|
||||
|
||||
@@ -268,7 +268,16 @@ export async function PATCH(request: NextRequest, { params }: RouteParams) {
|
||||
resourceId: connectorId,
|
||||
resourceName: updatedData.connectorType,
|
||||
description: `Updated connector for knowledge base "${writeCheck.knowledgeBase.name}"`,
|
||||
metadata: { knowledgeBaseId, updatedFields: Object.keys(parsed.data) },
|
||||
metadata: {
|
||||
knowledgeBaseId,
|
||||
knowledgeBaseName: writeCheck.knowledgeBase.name,
|
||||
connectorType: updatedData.connectorType,
|
||||
updatedFields: Object.keys(parsed.data),
|
||||
...(parsed.data.syncIntervalMinutes !== undefined && {
|
||||
syncIntervalMinutes: parsed.data.syncIntervalMinutes,
|
||||
}),
|
||||
...(parsed.data.status !== undefined && { newStatus: parsed.data.status }),
|
||||
},
|
||||
request,
|
||||
})
|
||||
|
||||
@@ -399,6 +408,9 @@ export async function DELETE(request: NextRequest, { params }: RouteParams) {
|
||||
description: `Deleted connector from knowledge base "${writeCheck.knowledgeBase.name}"`,
|
||||
metadata: {
|
||||
knowledgeBaseId,
|
||||
knowledgeBaseName: writeCheck.knowledgeBase.name,
|
||||
connectorType: existingConnector[0].connectorType,
|
||||
deleteDocuments,
|
||||
documentsDeleted: deleteDocuments ? docCount : 0,
|
||||
documentsKept: deleteDocuments ? 0 : docCount,
|
||||
},
|
||||
|
||||
@@ -78,7 +78,13 @@ export async function POST(request: NextRequest, { params }: RouteParams) {
|
||||
resourceId: connectorId,
|
||||
resourceName: connectorRows[0].connectorType,
|
||||
description: `Triggered manual sync for connector on knowledge base "${writeCheck.knowledgeBase.name}"`,
|
||||
metadata: { knowledgeBaseId },
|
||||
metadata: {
|
||||
knowledgeBaseId,
|
||||
knowledgeBaseName: writeCheck.knowledgeBase.name,
|
||||
connectorType: connectorRows[0].connectorType,
|
||||
connectorStatus: connectorRows[0].status,
|
||||
syncType: 'manual',
|
||||
},
|
||||
request,
|
||||
})
|
||||
|
||||
|
||||
@@ -286,7 +286,13 @@ export async function POST(request: NextRequest, { params }: { params: Promise<{
|
||||
resourceId: connectorId,
|
||||
resourceName: connectorType,
|
||||
description: `Created ${connectorType} connector for knowledge base "${writeCheck.knowledgeBase.name}"`,
|
||||
metadata: { knowledgeBaseId, connectorType, syncIntervalMinutes },
|
||||
metadata: {
|
||||
knowledgeBaseId,
|
||||
knowledgeBaseName: writeCheck.knowledgeBase.name,
|
||||
connectorType,
|
||||
syncIntervalMinutes,
|
||||
authMode: connectorConfig.auth.mode,
|
||||
},
|
||||
request,
|
||||
})
|
||||
|
||||
|
||||
@@ -208,7 +208,16 @@ export async function PUT(
|
||||
resourceType: AuditResourceType.DOCUMENT,
|
||||
resourceId: documentId,
|
||||
resourceName: validatedData.filename ?? accessCheck.document?.filename,
|
||||
description: `Updated document "${documentId}" in knowledge base "${knowledgeBaseId}"`,
|
||||
description: `Updated document "${validatedData.filename ?? accessCheck.document?.filename}" in knowledge base "${knowledgeBaseId}"`,
|
||||
metadata: {
|
||||
knowledgeBaseId,
|
||||
knowledgeBaseName: accessCheck.knowledgeBase?.name,
|
||||
fileName: validatedData.filename ?? accessCheck.document?.filename,
|
||||
updatedFields: Object.keys(validatedData).filter(
|
||||
(k) => validatedData[k as keyof typeof validatedData] !== undefined
|
||||
),
|
||||
...(validatedData.enabled !== undefined && { enabled: validatedData.enabled }),
|
||||
},
|
||||
request: req,
|
||||
})
|
||||
|
||||
@@ -281,8 +290,14 @@ export async function DELETE(
|
||||
resourceType: AuditResourceType.DOCUMENT,
|
||||
resourceId: documentId,
|
||||
resourceName: accessCheck.document?.filename,
|
||||
description: `Deleted document "${documentId}" from knowledge base "${knowledgeBaseId}"`,
|
||||
metadata: { fileName: accessCheck.document?.filename },
|
||||
description: `Deleted document "${accessCheck.document?.filename}" from knowledge base "${knowledgeBaseId}"`,
|
||||
metadata: {
|
||||
knowledgeBaseId,
|
||||
knowledgeBaseName: accessCheck.knowledgeBase?.name,
|
||||
fileName: accessCheck.document?.filename,
|
||||
fileSize: accessCheck.document?.fileSize,
|
||||
mimeType: accessCheck.document?.mimeType,
|
||||
},
|
||||
request: req,
|
||||
})
|
||||
|
||||
|
||||
@@ -278,8 +278,8 @@ export async function POST(req: NextRequest, { params }: { params: Promise<{ id:
|
||||
resourceName: `${createdDocuments.length} document(s)`,
|
||||
description: `Uploaded ${createdDocuments.length} document(s) to knowledge base "${knowledgeBaseId}"`,
|
||||
metadata: {
|
||||
knowledgeBaseName: accessCheck.knowledgeBase?.name,
|
||||
fileCount: createdDocuments.length,
|
||||
fileNames: createdDocuments.map((doc) => doc.filename),
|
||||
},
|
||||
request: req,
|
||||
})
|
||||
@@ -358,6 +358,7 @@ export async function POST(req: NextRequest, { params }: { params: Promise<{ id:
|
||||
resourceName: validatedData.filename,
|
||||
description: `Uploaded document "${validatedData.filename}" to knowledge base "${knowledgeBaseId}"`,
|
||||
metadata: {
|
||||
knowledgeBaseName: accessCheck.knowledgeBase?.name,
|
||||
fileName: validatedData.filename,
|
||||
fileType: validatedData.mimeType,
|
||||
fileSize: validatedData.fileSize,
|
||||
|
||||
@@ -196,7 +196,10 @@ export async function POST(req: NextRequest, { params }: { params: Promise<{ id:
|
||||
? `Upserted (replaced) document "${validatedData.filename}" in knowledge base "${knowledgeBaseId}"`
|
||||
: `Upserted (created) document "${validatedData.filename}" in knowledge base "${knowledgeBaseId}"`,
|
||||
metadata: {
|
||||
knowledgeBaseName: accessCheck.knowledgeBase?.name,
|
||||
fileName: validatedData.filename,
|
||||
fileType: validatedData.mimeType,
|
||||
fileSize: validatedData.fileSize,
|
||||
previousDocumentId: existingDocumentId,
|
||||
isUpdate,
|
||||
},
|
||||
|
||||
@@ -59,6 +59,9 @@ export async function POST(request: NextRequest, { params }: { params: Promise<{
|
||||
resourceId: id,
|
||||
resourceName: kb.name,
|
||||
description: `Restored knowledge base "${kb.name}"`,
|
||||
metadata: {
|
||||
knowledgeBaseName: kb.name,
|
||||
},
|
||||
request,
|
||||
})
|
||||
|
||||
|
||||
@@ -147,6 +147,20 @@ export async function PUT(req: NextRequest, { params }: { params: Promise<{ id:
|
||||
resourceId: id,
|
||||
resourceName: validatedData.name ?? updatedKnowledgeBase.name,
|
||||
description: `Updated knowledge base "${validatedData.name ?? updatedKnowledgeBase.name}"`,
|
||||
metadata: {
|
||||
updatedFields: Object.keys(validatedData).filter(
|
||||
(k) => validatedData[k as keyof typeof validatedData] !== undefined
|
||||
),
|
||||
...(validatedData.name && { newName: validatedData.name }),
|
||||
...(validatedData.description !== undefined && {
|
||||
description: validatedData.description,
|
||||
}),
|
||||
...(validatedData.chunkingConfig && {
|
||||
chunkMaxSize: validatedData.chunkingConfig.maxSize,
|
||||
chunkMinSize: validatedData.chunkingConfig.minSize,
|
||||
chunkOverlap: validatedData.chunkingConfig.overlap,
|
||||
}),
|
||||
},
|
||||
request: req,
|
||||
})
|
||||
|
||||
@@ -226,6 +240,9 @@ export async function DELETE(
|
||||
resourceId: id,
|
||||
resourceName: accessCheck.knowledgeBase.name,
|
||||
description: `Deleted knowledge base "${accessCheck.knowledgeBase.name || id}"`,
|
||||
metadata: {
|
||||
knowledgeBaseName: accessCheck.knowledgeBase.name,
|
||||
},
|
||||
request: _request,
|
||||
})
|
||||
|
||||
|
||||
@@ -162,7 +162,16 @@ export async function POST(req: NextRequest) {
|
||||
resourceId: newKnowledgeBase.id,
|
||||
resourceName: validatedData.name,
|
||||
description: `Created knowledge base "${validatedData.name}"`,
|
||||
metadata: { name: validatedData.name },
|
||||
metadata: {
|
||||
name: validatedData.name,
|
||||
description: validatedData.description,
|
||||
embeddingModel: validatedData.embeddingModel,
|
||||
embeddingDimension: validatedData.embeddingDimension,
|
||||
chunkingStrategy: validatedData.chunkingConfig.strategy,
|
||||
chunkMaxSize: validatedData.chunkingConfig.maxSize,
|
||||
chunkMinSize: validatedData.chunkingConfig.minSize,
|
||||
chunkOverlap: validatedData.chunkingConfig.overlap,
|
||||
},
|
||||
request: req,
|
||||
})
|
||||
|
||||
|
||||
@@ -124,6 +124,14 @@ export const PATCH = withMcpAuth<{ id: string }>('write')(
|
||||
resourceId: serverId,
|
||||
resourceName: updatedServer.name || serverId,
|
||||
description: `Updated MCP server "${updatedServer.name || serverId}"`,
|
||||
metadata: {
|
||||
serverName: updatedServer.name,
|
||||
transport: updatedServer.transport,
|
||||
url: updatedServer.url,
|
||||
updatedFields: Object.keys(updateData).filter(
|
||||
(k) => k !== 'workspaceId' && k !== 'updatedAt'
|
||||
),
|
||||
},
|
||||
request,
|
||||
})
|
||||
|
||||
|
||||
@@ -206,7 +206,14 @@ export const POST = withMcpAuth('write')(
|
||||
resourceId: serverId,
|
||||
resourceName: body.name,
|
||||
description: `Added MCP server "${body.name}"`,
|
||||
metadata: { serverName: body.name, transport: body.transport },
|
||||
metadata: {
|
||||
serverName: body.name,
|
||||
transport: body.transport,
|
||||
url: body.url,
|
||||
timeout: body.timeout || 30000,
|
||||
retries: body.retries || 3,
|
||||
source: source,
|
||||
},
|
||||
request,
|
||||
})
|
||||
|
||||
@@ -278,6 +285,12 @@ export const DELETE = withMcpAuth('admin')(
|
||||
resourceId: serverId!,
|
||||
resourceName: deletedServer.name,
|
||||
description: `Removed MCP server "${deletedServer.name}"`,
|
||||
metadata: {
|
||||
serverName: deletedServer.name,
|
||||
transport: deletedServer.transport,
|
||||
url: deletedServer.url,
|
||||
source,
|
||||
},
|
||||
request,
|
||||
})
|
||||
|
||||
|
||||
@@ -135,6 +135,11 @@ export const PATCH = withMcpAuth<RouteParams>('write')(
|
||||
resourceId: serverId,
|
||||
resourceName: updatedServer.name,
|
||||
description: `Updated workflow MCP server "${updatedServer.name}"`,
|
||||
metadata: {
|
||||
serverName: updatedServer.name,
|
||||
isPublic: updatedServer.isPublic,
|
||||
updatedFields: Object.keys(updateData).filter((k) => k !== 'updatedAt'),
|
||||
},
|
||||
request,
|
||||
})
|
||||
|
||||
@@ -189,6 +194,7 @@ export const DELETE = withMcpAuth<RouteParams>('admin')(
|
||||
resourceId: serverId,
|
||||
resourceName: deletedServer.name,
|
||||
description: `Unpublished workflow MCP server "${deletedServer.name}"`,
|
||||
metadata: { serverName: deletedServer.name },
|
||||
request,
|
||||
})
|
||||
|
||||
|
||||
@@ -152,7 +152,12 @@ export const PATCH = withMcpAuth<RouteParams>('write')(
|
||||
resourceType: AuditResourceType.MCP_SERVER,
|
||||
resourceId: serverId,
|
||||
description: `Updated tool "${updatedTool.toolName}" in MCP server`,
|
||||
metadata: { toolId, toolName: updatedTool.toolName },
|
||||
metadata: {
|
||||
toolId,
|
||||
toolName: updatedTool.toolName,
|
||||
workflowId: updatedTool.workflowId,
|
||||
updatedFields: Object.keys(updateData).filter((k) => k !== 'updatedAt'),
|
||||
},
|
||||
request,
|
||||
})
|
||||
|
||||
@@ -220,7 +225,7 @@ export const DELETE = withMcpAuth<RouteParams>('write')(
|
||||
resourceType: AuditResourceType.MCP_SERVER,
|
||||
resourceId: serverId,
|
||||
description: `Removed tool "${deletedTool.toolName}" from MCP server`,
|
||||
metadata: { toolId, toolName: deletedTool.toolName },
|
||||
metadata: { toolId, toolName: deletedTool.toolName, workflowId: deletedTool.workflowId },
|
||||
request,
|
||||
})
|
||||
|
||||
|
||||
@@ -224,7 +224,13 @@ export const POST = withMcpAuth<RouteParams>('write')(
|
||||
resourceType: AuditResourceType.MCP_SERVER,
|
||||
resourceId: serverId,
|
||||
description: `Added tool "${toolName}" to MCP server`,
|
||||
metadata: { toolId, toolName, workflowId: body.workflowId },
|
||||
metadata: {
|
||||
toolId,
|
||||
toolName,
|
||||
toolDescription,
|
||||
workflowId: body.workflowId,
|
||||
workflowName: workflowRecord.name,
|
||||
},
|
||||
request,
|
||||
})
|
||||
|
||||
|
||||
@@ -208,6 +208,13 @@ export const POST = withMcpAuth('write')(
|
||||
resourceId: serverId,
|
||||
resourceName: body.name.trim(),
|
||||
description: `Published workflow MCP server "${body.name.trim()}" with ${addedTools.length} tool(s)`,
|
||||
metadata: {
|
||||
serverName: body.name.trim(),
|
||||
isPublic: body.isPublic ?? false,
|
||||
toolCount: addedTools.length,
|
||||
toolNames: addedTools.map((t) => t.toolName),
|
||||
workflowIds: addedTools.map((t) => t.workflowId),
|
||||
},
|
||||
request,
|
||||
})
|
||||
|
||||
|
||||
@@ -182,6 +182,20 @@ export async function POST(
|
||||
email: orgInvitation.email,
|
||||
})
|
||||
|
||||
recordAudit({
|
||||
workspaceId: null,
|
||||
actorId: session.user.id,
|
||||
action: AuditAction.ORG_INVITATION_RESENT,
|
||||
resourceType: AuditResourceType.ORGANIZATION,
|
||||
resourceId: organizationId,
|
||||
actorName: session.user.name ?? undefined,
|
||||
actorEmail: session.user.email ?? undefined,
|
||||
resourceName: org?.name ?? undefined,
|
||||
description: `Resent organization invitation to ${orgInvitation.email}`,
|
||||
metadata: { invitationId, targetEmail: orgInvitation.email, targetRole: orgInvitation.role },
|
||||
request: _request,
|
||||
})
|
||||
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
message: 'Invitation resent successfully',
|
||||
|
||||
@@ -423,7 +423,13 @@ export async function POST(request: NextRequest, { params }: { params: Promise<{
|
||||
actorEmail: session.user.email ?? undefined,
|
||||
resourceName: organizationEntry[0]?.name,
|
||||
description: `Invited ${inv.email} to organization as ${role}`,
|
||||
metadata: { invitationId: inv.id, targetEmail: inv.email, targetRole: role },
|
||||
metadata: {
|
||||
invitationId: inv.id,
|
||||
targetEmail: inv.email,
|
||||
targetRole: role,
|
||||
isBatch,
|
||||
workspaceInvitationCount: validWorkspaceInvitations.length,
|
||||
},
|
||||
request,
|
||||
})
|
||||
}
|
||||
@@ -558,7 +564,7 @@ export async function DELETE(
|
||||
actorName: session.user.name ?? undefined,
|
||||
actorEmail: session.user.email ?? undefined,
|
||||
description: `Revoked organization invitation for ${result[0].email}`,
|
||||
metadata: { invitationId, targetEmail: result[0].email },
|
||||
metadata: { invitationId, targetEmail: result[0].email, targetRole: result[0].role },
|
||||
request,
|
||||
})
|
||||
|
||||
|
||||
@@ -294,6 +294,7 @@ export async function POST(request: NextRequest, { params }: { params: Promise<{
|
||||
resourceId: organizationId,
|
||||
actorName: session.user.name ?? undefined,
|
||||
actorEmail: session.user.email ?? undefined,
|
||||
resourceName: organizationEntry[0]?.name ?? undefined,
|
||||
description: `Invited ${normalizedEmail} to organization as ${role}`,
|
||||
metadata: { invitationId, targetEmail: normalizedEmail, targetRole: role },
|
||||
request,
|
||||
|
||||
@@ -126,6 +126,7 @@ export async function POST(request: Request) {
|
||||
actorEmail: user.email ?? undefined,
|
||||
resourceName: organizationName ?? undefined,
|
||||
description: `Created organization "${organizationName}"`,
|
||||
metadata: { organizationSlug },
|
||||
request,
|
||||
})
|
||||
|
||||
|
||||
@@ -21,7 +21,10 @@ const configSchema = z.object({
|
||||
hideKnowledgeBaseTab: z.boolean().optional(),
|
||||
hideTablesTab: z.boolean().optional(),
|
||||
hideCopilot: z.boolean().optional(),
|
||||
hideIntegrationsTab: z.boolean().optional(),
|
||||
hideSecretsTab: z.boolean().optional(),
|
||||
hideApiKeysTab: z.boolean().optional(),
|
||||
hideInboxTab: z.boolean().optional(),
|
||||
hideEnvironmentTab: z.boolean().optional(),
|
||||
hideFilesTab: z.boolean().optional(),
|
||||
disableMcpTools: z.boolean().optional(),
|
||||
@@ -29,6 +32,7 @@ const configSchema = z.object({
|
||||
disableSkills: z.boolean().optional(),
|
||||
hideTemplates: z.boolean().optional(),
|
||||
disableInvitations: z.boolean().optional(),
|
||||
disablePublicApi: z.boolean().optional(),
|
||||
hideDeployApi: z.boolean().optional(),
|
||||
hideDeployMcp: z.boolean().optional(),
|
||||
hideDeployA2a: z.boolean().optional(),
|
||||
@@ -151,31 +155,34 @@ export async function PUT(req: NextRequest, { params }: { params: Promise<{ id:
|
||||
? { ...currentConfig, ...updates.config }
|
||||
: currentConfig
|
||||
|
||||
// If setting autoAddNewMembers to true, unset it on other groups in the org first
|
||||
if (updates.autoAddNewMembers === true) {
|
||||
await db
|
||||
.update(permissionGroup)
|
||||
.set({ autoAddNewMembers: false, updatedAt: new Date() })
|
||||
.where(
|
||||
and(
|
||||
eq(permissionGroup.organizationId, result.group.organizationId),
|
||||
eq(permissionGroup.autoAddNewMembers, true)
|
||||
)
|
||||
)
|
||||
}
|
||||
const now = new Date()
|
||||
|
||||
await db
|
||||
.update(permissionGroup)
|
||||
.set({
|
||||
...(updates.name !== undefined && { name: updates.name }),
|
||||
...(updates.description !== undefined && { description: updates.description }),
|
||||
...(updates.autoAddNewMembers !== undefined && {
|
||||
autoAddNewMembers: updates.autoAddNewMembers,
|
||||
}),
|
||||
config: newConfig,
|
||||
updatedAt: new Date(),
|
||||
})
|
||||
.where(eq(permissionGroup.id, id))
|
||||
await db.transaction(async (tx) => {
|
||||
if (updates.autoAddNewMembers === true) {
|
||||
await tx
|
||||
.update(permissionGroup)
|
||||
.set({ autoAddNewMembers: false, updatedAt: now })
|
||||
.where(
|
||||
and(
|
||||
eq(permissionGroup.organizationId, result.group.organizationId),
|
||||
eq(permissionGroup.autoAddNewMembers, true)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
await tx
|
||||
.update(permissionGroup)
|
||||
.set({
|
||||
...(updates.name !== undefined && { name: updates.name }),
|
||||
...(updates.description !== undefined && { description: updates.description }),
|
||||
...(updates.autoAddNewMembers !== undefined && {
|
||||
autoAddNewMembers: updates.autoAddNewMembers,
|
||||
}),
|
||||
config: newConfig,
|
||||
updatedAt: now,
|
||||
})
|
||||
.where(eq(permissionGroup.id, id))
|
||||
})
|
||||
|
||||
const [updated] = await db
|
||||
.select()
|
||||
@@ -193,6 +200,12 @@ export async function PUT(req: NextRequest, { params }: { params: Promise<{ id:
|
||||
actorEmail: session.user.email ?? undefined,
|
||||
resourceName: updated.name,
|
||||
description: `Updated permission group "${updated.name}"`,
|
||||
metadata: {
|
||||
organizationId: result.group.organizationId,
|
||||
updatedFields: Object.keys(updates).filter(
|
||||
(k) => updates[k as keyof typeof updates] !== undefined
|
||||
),
|
||||
},
|
||||
request: req,
|
||||
})
|
||||
|
||||
@@ -239,8 +252,10 @@ export async function DELETE(req: NextRequest, { params }: { params: Promise<{ i
|
||||
return NextResponse.json({ error: 'Admin or owner permissions required' }, { status: 403 })
|
||||
}
|
||||
|
||||
await db.delete(permissionGroupMember).where(eq(permissionGroupMember.permissionGroupId, id))
|
||||
await db.delete(permissionGroup).where(eq(permissionGroup.id, id))
|
||||
await db.transaction(async (tx) => {
|
||||
await tx.delete(permissionGroupMember).where(eq(permissionGroupMember.permissionGroupId, id))
|
||||
await tx.delete(permissionGroup).where(eq(permissionGroup.id, id))
|
||||
})
|
||||
|
||||
logger.info('Deleted permission group', { permissionGroupId: id, userId: session.user.id })
|
||||
|
||||
@@ -254,6 +269,7 @@ export async function DELETE(req: NextRequest, { params }: { params: Promise<{ i
|
||||
actorEmail: session.user.email ?? undefined,
|
||||
resourceName: result.group.name,
|
||||
description: `Deleted permission group "${result.group.name}"`,
|
||||
metadata: { organizationId: result.group.organizationId },
|
||||
request: req,
|
||||
})
|
||||
|
||||
|
||||
@@ -23,7 +23,10 @@ const configSchema = z.object({
|
||||
hideKnowledgeBaseTab: z.boolean().optional(),
|
||||
hideTablesTab: z.boolean().optional(),
|
||||
hideCopilot: z.boolean().optional(),
|
||||
hideIntegrationsTab: z.boolean().optional(),
|
||||
hideSecretsTab: z.boolean().optional(),
|
||||
hideApiKeysTab: z.boolean().optional(),
|
||||
hideInboxTab: z.boolean().optional(),
|
||||
hideEnvironmentTab: z.boolean().optional(),
|
||||
hideFilesTab: z.boolean().optional(),
|
||||
disableMcpTools: z.boolean().optional(),
|
||||
@@ -31,6 +34,7 @@ const configSchema = z.object({
|
||||
disableSkills: z.boolean().optional(),
|
||||
hideTemplates: z.boolean().optional(),
|
||||
disableInvitations: z.boolean().optional(),
|
||||
disablePublicApi: z.boolean().optional(),
|
||||
hideDeployApi: z.boolean().optional(),
|
||||
hideDeployMcp: z.boolean().optional(),
|
||||
hideDeployA2a: z.boolean().optional(),
|
||||
@@ -167,19 +171,6 @@ export async function POST(req: Request) {
|
||||
...config,
|
||||
}
|
||||
|
||||
// If autoAddNewMembers is true, unset it on any existing groups first
|
||||
if (autoAddNewMembers) {
|
||||
await db
|
||||
.update(permissionGroup)
|
||||
.set({ autoAddNewMembers: false, updatedAt: new Date() })
|
||||
.where(
|
||||
and(
|
||||
eq(permissionGroup.organizationId, organizationId),
|
||||
eq(permissionGroup.autoAddNewMembers, true)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
const now = new Date()
|
||||
const newGroup = {
|
||||
id: generateId(),
|
||||
@@ -193,7 +184,20 @@ export async function POST(req: Request) {
|
||||
autoAddNewMembers: autoAddNewMembers || false,
|
||||
}
|
||||
|
||||
await db.insert(permissionGroup).values(newGroup)
|
||||
await db.transaction(async (tx) => {
|
||||
if (autoAddNewMembers) {
|
||||
await tx
|
||||
.update(permissionGroup)
|
||||
.set({ autoAddNewMembers: false, updatedAt: now })
|
||||
.where(
|
||||
and(
|
||||
eq(permissionGroup.organizationId, organizationId),
|
||||
eq(permissionGroup.autoAddNewMembers, true)
|
||||
)
|
||||
)
|
||||
}
|
||||
await tx.insert(permissionGroup).values(newGroup)
|
||||
})
|
||||
|
||||
logger.info('Created permission group', {
|
||||
permissionGroupId: newGroup.id,
|
||||
@@ -211,6 +215,7 @@ export async function POST(req: Request) {
|
||||
actorEmail: session.user.email ?? undefined,
|
||||
resourceName: name,
|
||||
description: `Created permission group "${name}"`,
|
||||
metadata: { organizationId, autoAddNewMembers: autoAddNewMembers || false },
|
||||
request: req,
|
||||
})
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ type ScheduleRow = {
|
||||
timezone: string | null
|
||||
sourceType: string | null
|
||||
sourceWorkspaceId: string | null
|
||||
jobTitle: string | null
|
||||
}
|
||||
|
||||
async function fetchAndAuthorize(
|
||||
@@ -55,6 +56,7 @@ async function fetchAndAuthorize(
|
||||
timezone: workflowSchedule.timezone,
|
||||
sourceType: workflowSchedule.sourceType,
|
||||
sourceWorkspaceId: workflowSchedule.sourceWorkspaceId,
|
||||
jobTitle: workflowSchedule.jobTitle,
|
||||
})
|
||||
.from(workflowSchedule)
|
||||
.where(and(eq(workflowSchedule.id, scheduleId), isNull(workflowSchedule.archivedAt)))
|
||||
@@ -144,13 +146,18 @@ export async function PUT(request: NextRequest, { params }: { params: Promise<{
|
||||
recordAudit({
|
||||
workspaceId,
|
||||
actorId: session.user.id,
|
||||
actorName: session.user.name,
|
||||
actorEmail: session.user.email,
|
||||
action: AuditAction.SCHEDULE_UPDATED,
|
||||
resourceType: AuditResourceType.SCHEDULE,
|
||||
resourceId: scheduleId,
|
||||
actorName: session.user.name ?? undefined,
|
||||
actorEmail: session.user.email ?? undefined,
|
||||
description: `Disabled schedule ${scheduleId}`,
|
||||
metadata: {},
|
||||
resourceName: schedule.jobTitle ?? undefined,
|
||||
description: `Disabled schedule "${schedule.jobTitle ?? scheduleId}"`,
|
||||
metadata: {
|
||||
operation: 'disable',
|
||||
sourceType: schedule.sourceType,
|
||||
previousStatus: schedule.status,
|
||||
},
|
||||
request,
|
||||
})
|
||||
|
||||
@@ -204,13 +211,17 @@ export async function PUT(request: NextRequest, { params }: { params: Promise<{
|
||||
recordAudit({
|
||||
workspaceId,
|
||||
actorId: session.user.id,
|
||||
actorName: session.user.name,
|
||||
actorEmail: session.user.email,
|
||||
action: AuditAction.SCHEDULE_UPDATED,
|
||||
resourceType: AuditResourceType.SCHEDULE,
|
||||
resourceId: scheduleId,
|
||||
actorName: session.user.name ?? undefined,
|
||||
actorEmail: session.user.email ?? undefined,
|
||||
description: `Updated job schedule ${scheduleId}`,
|
||||
metadata: {},
|
||||
resourceName: schedule.jobTitle ?? undefined,
|
||||
description: `Updated job schedule "${schedule.jobTitle ?? scheduleId}"`,
|
||||
metadata: {
|
||||
operation: 'update',
|
||||
updatedFields: Object.keys(setFields).filter((k) => k !== 'updatedAt'),
|
||||
},
|
||||
request,
|
||||
})
|
||||
|
||||
@@ -246,13 +257,19 @@ export async function PUT(request: NextRequest, { params }: { params: Promise<{
|
||||
recordAudit({
|
||||
workspaceId,
|
||||
actorId: session.user.id,
|
||||
actorName: session.user.name,
|
||||
actorEmail: session.user.email,
|
||||
action: AuditAction.SCHEDULE_UPDATED,
|
||||
resourceType: AuditResourceType.SCHEDULE,
|
||||
resourceId: scheduleId,
|
||||
actorName: session.user.name ?? undefined,
|
||||
actorEmail: session.user.email ?? undefined,
|
||||
description: `Reactivated schedule ${scheduleId}`,
|
||||
metadata: { cronExpression: schedule.cronExpression, timezone: schedule.timezone },
|
||||
resourceName: schedule.jobTitle ?? undefined,
|
||||
description: `Reactivated schedule "${schedule.jobTitle ?? scheduleId}"`,
|
||||
metadata: {
|
||||
operation: 'reactivate',
|
||||
sourceType: schedule.sourceType,
|
||||
cronExpression: schedule.cronExpression,
|
||||
timezone: schedule.timezone,
|
||||
},
|
||||
request,
|
||||
})
|
||||
|
||||
@@ -289,13 +306,18 @@ export async function DELETE(
|
||||
recordAudit({
|
||||
workspaceId,
|
||||
actorId: session.user.id,
|
||||
action: AuditAction.SCHEDULE_UPDATED,
|
||||
actorName: session.user.name,
|
||||
actorEmail: session.user.email,
|
||||
action: AuditAction.SCHEDULE_DELETED,
|
||||
resourceType: AuditResourceType.SCHEDULE,
|
||||
resourceId: scheduleId,
|
||||
actorName: session.user.name ?? undefined,
|
||||
actorEmail: session.user.email ?? undefined,
|
||||
description: `Deleted ${schedule.sourceType === 'job' ? 'job' : 'schedule'} ${scheduleId}`,
|
||||
metadata: {},
|
||||
resourceName: schedule.jobTitle ?? undefined,
|
||||
description: `Deleted ${schedule.sourceType === 'job' ? 'job' : 'schedule'} "${schedule.jobTitle ?? scheduleId}"`,
|
||||
metadata: {
|
||||
sourceType: schedule.sourceType,
|
||||
cronExpression: schedule.cronExpression,
|
||||
timezone: schedule.timezone,
|
||||
},
|
||||
request,
|
||||
})
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import { workflow, workflowDeploymentVersion, workflowSchedule } from '@sim/db/s
|
||||
import { createLogger } from '@sim/logger'
|
||||
import { and, eq, isNull, or } from 'drizzle-orm'
|
||||
import { type NextRequest, NextResponse } from 'next/server'
|
||||
import { AuditAction, AuditResourceType, recordAudit } from '@/lib/audit/log'
|
||||
import { getSession } from '@/lib/auth'
|
||||
import { generateRequestId } from '@/lib/core/utils/request'
|
||||
import { generateId } from '@/lib/core/utils/uuid'
|
||||
@@ -279,6 +280,25 @@ export async function POST(req: NextRequest) {
|
||||
lifecycle,
|
||||
})
|
||||
|
||||
recordAudit({
|
||||
workspaceId,
|
||||
actorId: session.user.id,
|
||||
actorName: session.user.name,
|
||||
actorEmail: session.user.email,
|
||||
action: AuditAction.SCHEDULE_CREATED,
|
||||
resourceType: AuditResourceType.SCHEDULE,
|
||||
resourceId: id,
|
||||
resourceName: title.trim(),
|
||||
description: `Created job schedule "${title.trim()}"`,
|
||||
metadata: {
|
||||
cronExpression,
|
||||
timezone,
|
||||
lifecycle,
|
||||
maxRuns: maxRuns ?? null,
|
||||
},
|
||||
request: req,
|
||||
})
|
||||
|
||||
captureServerEvent(
|
||||
session.user.id,
|
||||
'scheduled_task_created',
|
||||
|
||||
14
apps/sim/app/api/settings/allowed-providers/route.ts
Normal file
14
apps/sim/app/api/settings/allowed-providers/route.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { NextResponse } from 'next/server'
|
||||
import { getSession } from '@/lib/auth'
|
||||
import { getBlacklistedProvidersFromEnv } from '@/lib/core/config/feature-flags'
|
||||
|
||||
export async function GET() {
|
||||
const session = await getSession()
|
||||
if (!session?.user?.id) {
|
||||
return NextResponse.json({ error: 'Unauthorized' }, { status: 401 })
|
||||
}
|
||||
|
||||
return NextResponse.json({
|
||||
blacklistedProviders: getBlacklistedProvidersFromEnv(),
|
||||
})
|
||||
}
|
||||
@@ -103,11 +103,14 @@ export async function POST(req: NextRequest) {
|
||||
recordAudit({
|
||||
workspaceId,
|
||||
actorId: userId,
|
||||
actorName: authResult.userName ?? undefined,
|
||||
actorEmail: authResult.userEmail ?? undefined,
|
||||
action: AuditAction.SKILL_CREATED,
|
||||
resourceType: AuditResourceType.SKILL,
|
||||
resourceId: skill.id,
|
||||
resourceName: skill.name,
|
||||
description: `Created/updated skill "${skill.name}"`,
|
||||
metadata: { source },
|
||||
})
|
||||
captureServerEvent(
|
||||
userId,
|
||||
@@ -185,10 +188,13 @@ export async function DELETE(request: NextRequest) {
|
||||
recordAudit({
|
||||
workspaceId,
|
||||
actorId: authResult.userId,
|
||||
actorName: authResult.userName ?? undefined,
|
||||
actorEmail: authResult.userEmail ?? undefined,
|
||||
action: AuditAction.SKILL_DELETED,
|
||||
resourceType: AuditResourceType.SKILL,
|
||||
resourceId: skillId,
|
||||
description: `Deleted skill`,
|
||||
metadata: { source },
|
||||
})
|
||||
|
||||
captureServerEvent(
|
||||
|
||||
@@ -45,6 +45,10 @@ export async function POST(
|
||||
resourceId: tableId,
|
||||
resourceName: table.name,
|
||||
description: `Restored table "${table.name}"`,
|
||||
metadata: {
|
||||
tableName: table.name,
|
||||
workspaceId: table.workspaceId,
|
||||
},
|
||||
request,
|
||||
})
|
||||
|
||||
|
||||
@@ -251,6 +251,15 @@ export async function PUT(request: NextRequest, { params }: { params: Promise<{
|
||||
resourceId: id,
|
||||
resourceName: name ?? template.name,
|
||||
description: `Updated template "${name ?? template.name}"`,
|
||||
metadata: {
|
||||
templateName: name ?? template.name,
|
||||
updatedFields: Object.keys(validationResult.data).filter(
|
||||
(k) => validationResult.data[k as keyof typeof validationResult.data] !== undefined
|
||||
),
|
||||
statusChange: status !== undefined ? { from: template.status, to: status } : undefined,
|
||||
stateUpdated: updateState || false,
|
||||
workflowId: template.workflowId || undefined,
|
||||
},
|
||||
request,
|
||||
})
|
||||
|
||||
@@ -317,6 +326,13 @@ export async function DELETE(
|
||||
resourceId: id,
|
||||
resourceName: template.name,
|
||||
description: `Deleted template "${template.name}"`,
|
||||
metadata: {
|
||||
templateName: template.name,
|
||||
workflowId: template.workflowId || undefined,
|
||||
creatorId: template.creatorId || undefined,
|
||||
status: template.status,
|
||||
tags: template.tags,
|
||||
},
|
||||
request,
|
||||
})
|
||||
|
||||
|
||||
@@ -346,6 +346,14 @@ export async function POST(request: NextRequest) {
|
||||
resourceId: templateId,
|
||||
resourceName: data.name,
|
||||
description: `Created template "${data.name}"`,
|
||||
metadata: {
|
||||
templateName: data.name,
|
||||
workflowId: data.workflowId,
|
||||
creatorId: data.creatorId,
|
||||
tags: data.tags,
|
||||
tagline: data.details?.tagline || undefined,
|
||||
status: 'pending',
|
||||
},
|
||||
request,
|
||||
})
|
||||
|
||||
|
||||
@@ -183,11 +183,14 @@ export async function POST(req: NextRequest) {
|
||||
recordAudit({
|
||||
workspaceId,
|
||||
actorId: userId,
|
||||
actorName: authResult.userName ?? undefined,
|
||||
actorEmail: authResult.userEmail ?? undefined,
|
||||
action: AuditAction.CUSTOM_TOOL_CREATED,
|
||||
resourceType: AuditResourceType.CUSTOM_TOOL,
|
||||
resourceId: tool.id,
|
||||
resourceName: tool.title,
|
||||
description: `Created/updated custom tool "${tool.title}"`,
|
||||
metadata: { source },
|
||||
})
|
||||
}
|
||||
|
||||
@@ -304,10 +307,14 @@ export async function DELETE(request: NextRequest) {
|
||||
recordAudit({
|
||||
workspaceId: tool.workspaceId || undefined,
|
||||
actorId: userId,
|
||||
actorName: authResult.userName ?? undefined,
|
||||
actorEmail: authResult.userEmail ?? undefined,
|
||||
action: AuditAction.CUSTOM_TOOL_DELETED,
|
||||
resourceType: AuditResourceType.CUSTOM_TOOL,
|
||||
resourceId: toolId,
|
||||
description: `Deleted custom tool`,
|
||||
resourceName: tool.title,
|
||||
description: `Deleted custom tool "${tool.title}"`,
|
||||
metadata: { source },
|
||||
})
|
||||
|
||||
logger.info(`[${requestId}] Deleted tool: ${toolId}`)
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
import { db } from '@sim/db'
|
||||
import { auditLog } from '@sim/db/schema'
|
||||
import { createLogger } from '@sim/logger'
|
||||
import { and, count, desc, eq, gte, lte, type SQL } from 'drizzle-orm'
|
||||
import { and, count, desc } from 'drizzle-orm'
|
||||
import { withAdminAuth } from '@/app/api/v1/admin/middleware'
|
||||
import {
|
||||
badRequestResponse,
|
||||
@@ -34,6 +34,7 @@ import {
|
||||
parsePaginationParams,
|
||||
toAdminAuditLog,
|
||||
} from '@/app/api/v1/admin/types'
|
||||
import { buildFilterConditions } from '@/app/api/v1/audit-logs/query'
|
||||
|
||||
const logger = createLogger('AdminAuditLogsAPI')
|
||||
|
||||
@@ -41,33 +42,27 @@ export const GET = withAdminAuth(async (request) => {
|
||||
const url = new URL(request.url)
|
||||
const { limit, offset } = parsePaginationParams(url)
|
||||
|
||||
const actionFilter = url.searchParams.get('action')
|
||||
const resourceTypeFilter = url.searchParams.get('resourceType')
|
||||
const resourceIdFilter = url.searchParams.get('resourceId')
|
||||
const workspaceIdFilter = url.searchParams.get('workspaceId')
|
||||
const actorIdFilter = url.searchParams.get('actorId')
|
||||
const actorEmailFilter = url.searchParams.get('actorEmail')
|
||||
const startDateFilter = url.searchParams.get('startDate')
|
||||
const endDateFilter = url.searchParams.get('endDate')
|
||||
const startDate = url.searchParams.get('startDate') || undefined
|
||||
const endDate = url.searchParams.get('endDate') || undefined
|
||||
|
||||
if (startDateFilter && Number.isNaN(Date.parse(startDateFilter))) {
|
||||
if (startDate && Number.isNaN(Date.parse(startDate))) {
|
||||
return badRequestResponse('Invalid startDate format. Use ISO 8601.')
|
||||
}
|
||||
if (endDateFilter && Number.isNaN(Date.parse(endDateFilter))) {
|
||||
if (endDate && Number.isNaN(Date.parse(endDate))) {
|
||||
return badRequestResponse('Invalid endDate format. Use ISO 8601.')
|
||||
}
|
||||
|
||||
try {
|
||||
const conditions: SQL<unknown>[] = []
|
||||
|
||||
if (actionFilter) conditions.push(eq(auditLog.action, actionFilter))
|
||||
if (resourceTypeFilter) conditions.push(eq(auditLog.resourceType, resourceTypeFilter))
|
||||
if (resourceIdFilter) conditions.push(eq(auditLog.resourceId, resourceIdFilter))
|
||||
if (workspaceIdFilter) conditions.push(eq(auditLog.workspaceId, workspaceIdFilter))
|
||||
if (actorIdFilter) conditions.push(eq(auditLog.actorId, actorIdFilter))
|
||||
if (actorEmailFilter) conditions.push(eq(auditLog.actorEmail, actorEmailFilter))
|
||||
if (startDateFilter) conditions.push(gte(auditLog.createdAt, new Date(startDateFilter)))
|
||||
if (endDateFilter) conditions.push(lte(auditLog.createdAt, new Date(endDateFilter)))
|
||||
const conditions = buildFilterConditions({
|
||||
action: url.searchParams.get('action') || undefined,
|
||||
resourceType: url.searchParams.get('resourceType') || undefined,
|
||||
resourceId: url.searchParams.get('resourceId') || undefined,
|
||||
workspaceId: url.searchParams.get('workspaceId') || undefined,
|
||||
actorId: url.searchParams.get('actorId') || undefined,
|
||||
actorEmail: url.searchParams.get('actorEmail') || undefined,
|
||||
startDate,
|
||||
endDate,
|
||||
})
|
||||
|
||||
const whereClause = conditions.length > 0 ? and(...conditions) : undefined
|
||||
|
||||
|
||||
146
apps/sim/app/api/v1/audit-logs/query.ts
Normal file
146
apps/sim/app/api/v1/audit-logs/query.ts
Normal file
@@ -0,0 +1,146 @@
|
||||
import { db } from '@sim/db'
|
||||
import { auditLog, workspace } from '@sim/db/schema'
|
||||
import type { InferSelectModel } from 'drizzle-orm'
|
||||
import { and, desc, eq, gte, ilike, inArray, lt, lte, or, type SQL, sql } from 'drizzle-orm'
|
||||
|
||||
type DbAuditLog = InferSelectModel<typeof auditLog>
|
||||
|
||||
interface CursorData {
|
||||
createdAt: string
|
||||
id: string
|
||||
}
|
||||
|
||||
function encodeCursor(data: CursorData): string {
|
||||
return Buffer.from(JSON.stringify(data)).toString('base64')
|
||||
}
|
||||
|
||||
function decodeCursor(cursor: string): CursorData | null {
|
||||
try {
|
||||
return JSON.parse(Buffer.from(cursor, 'base64').toString())
|
||||
} catch {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
export interface AuditLogFilterParams {
|
||||
action?: string
|
||||
resourceType?: string
|
||||
resourceId?: string
|
||||
workspaceId?: string
|
||||
actorId?: string
|
||||
actorEmail?: string
|
||||
search?: string
|
||||
startDate?: string
|
||||
endDate?: string
|
||||
}
|
||||
|
||||
export function buildFilterConditions(params: AuditLogFilterParams): SQL<unknown>[] {
|
||||
const conditions: SQL<unknown>[] = []
|
||||
|
||||
if (params.action) conditions.push(eq(auditLog.action, params.action))
|
||||
if (params.resourceType) conditions.push(eq(auditLog.resourceType, params.resourceType))
|
||||
if (params.resourceId) conditions.push(eq(auditLog.resourceId, params.resourceId))
|
||||
if (params.workspaceId) conditions.push(eq(auditLog.workspaceId, params.workspaceId))
|
||||
if (params.actorId) conditions.push(eq(auditLog.actorId, params.actorId))
|
||||
if (params.actorEmail) conditions.push(eq(auditLog.actorEmail, params.actorEmail))
|
||||
|
||||
if (params.search) {
|
||||
const escaped = params.search.replace(/[%_\\]/g, '\\$&')
|
||||
const searchTerm = `%${escaped}%`
|
||||
conditions.push(
|
||||
or(
|
||||
ilike(auditLog.action, searchTerm),
|
||||
ilike(auditLog.actorEmail, searchTerm),
|
||||
ilike(auditLog.actorName, searchTerm),
|
||||
ilike(auditLog.resourceName, searchTerm),
|
||||
ilike(auditLog.description, searchTerm)
|
||||
)!
|
||||
)
|
||||
}
|
||||
|
||||
if (params.startDate) conditions.push(gte(auditLog.createdAt, new Date(params.startDate)))
|
||||
if (params.endDate) conditions.push(lte(auditLog.createdAt, new Date(params.endDate)))
|
||||
|
||||
return conditions
|
||||
}
|
||||
|
||||
export async function buildOrgScopeCondition(
|
||||
orgMemberIds: string[],
|
||||
includeDeparted: boolean
|
||||
): Promise<SQL<unknown>> {
|
||||
if (orgMemberIds.length === 0) {
|
||||
return sql`1 = 0`
|
||||
}
|
||||
|
||||
if (!includeDeparted) {
|
||||
return inArray(auditLog.actorId, orgMemberIds)
|
||||
}
|
||||
|
||||
const orgWorkspaces = await db
|
||||
.select({ id: workspace.id })
|
||||
.from(workspace)
|
||||
.where(inArray(workspace.ownerId, orgMemberIds))
|
||||
|
||||
const orgWorkspaceIds = orgWorkspaces.map((w) => w.id)
|
||||
|
||||
if (orgWorkspaceIds.length > 0) {
|
||||
return or(
|
||||
inArray(auditLog.actorId, orgMemberIds),
|
||||
inArray(auditLog.workspaceId, orgWorkspaceIds)
|
||||
)!
|
||||
}
|
||||
|
||||
return inArray(auditLog.actorId, orgMemberIds)
|
||||
}
|
||||
|
||||
function buildCursorCondition(cursor: string): SQL<unknown> | null {
|
||||
const cursorData = decodeCursor(cursor)
|
||||
if (!cursorData?.createdAt || !cursorData.id) return null
|
||||
|
||||
const cursorDate = new Date(cursorData.createdAt)
|
||||
if (Number.isNaN(cursorDate.getTime())) return null
|
||||
|
||||
return or(
|
||||
lt(auditLog.createdAt, cursorDate),
|
||||
and(eq(auditLog.createdAt, cursorDate), lt(auditLog.id, cursorData.id))
|
||||
)!
|
||||
}
|
||||
|
||||
interface CursorPaginatedResult {
|
||||
data: DbAuditLog[]
|
||||
nextCursor?: string
|
||||
}
|
||||
|
||||
export async function queryAuditLogs(
|
||||
conditions: SQL<unknown>[],
|
||||
limit: number,
|
||||
cursor?: string
|
||||
): Promise<CursorPaginatedResult> {
|
||||
const allConditions = [...conditions]
|
||||
|
||||
if (cursor) {
|
||||
const cursorCondition = buildCursorCondition(cursor)
|
||||
if (cursorCondition) allConditions.push(cursorCondition)
|
||||
}
|
||||
|
||||
const rows = await db
|
||||
.select()
|
||||
.from(auditLog)
|
||||
.where(allConditions.length > 0 ? and(...allConditions) : undefined)
|
||||
.orderBy(desc(auditLog.createdAt), desc(auditLog.id))
|
||||
.limit(limit + 1)
|
||||
|
||||
const hasMore = rows.length > limit
|
||||
const data = rows.slice(0, limit)
|
||||
|
||||
let nextCursor: string | undefined
|
||||
if (hasMore && data.length > 0) {
|
||||
const last = data[data.length - 1]
|
||||
nextCursor = encodeCursor({
|
||||
createdAt: last.createdAt.toISOString(),
|
||||
id: last.id,
|
||||
})
|
||||
}
|
||||
|
||||
return { data, nextCursor }
|
||||
}
|
||||
@@ -19,15 +19,17 @@
|
||||
* Response: { data: AuditLogEntry[], nextCursor?: string, limits: UserLimits }
|
||||
*/
|
||||
|
||||
import { db } from '@sim/db'
|
||||
import { auditLog, workspace } from '@sim/db/schema'
|
||||
import { createLogger } from '@sim/logger'
|
||||
import { and, desc, eq, gte, inArray, lt, lte, or, type SQL } from 'drizzle-orm'
|
||||
import { type NextRequest, NextResponse } from 'next/server'
|
||||
import { z } from 'zod'
|
||||
import { generateId } from '@/lib/core/utils/uuid'
|
||||
import { validateEnterpriseAuditAccess } from '@/app/api/v1/audit-logs/auth'
|
||||
import { formatAuditLogEntry } from '@/app/api/v1/audit-logs/format'
|
||||
import {
|
||||
buildFilterConditions,
|
||||
buildOrgScopeCondition,
|
||||
queryAuditLogs,
|
||||
} from '@/app/api/v1/audit-logs/query'
|
||||
import { createApiResponse, getUserLimits } from '@/app/api/v1/logs/meta'
|
||||
import { checkRateLimit, createRateLimitResponse } from '@/app/api/v1/middleware'
|
||||
|
||||
@@ -57,23 +59,6 @@ const QueryParamsSchema = z.object({
|
||||
cursor: z.string().optional(),
|
||||
})
|
||||
|
||||
interface CursorData {
|
||||
createdAt: string
|
||||
id: string
|
||||
}
|
||||
|
||||
function encodeCursor(data: CursorData): string {
|
||||
return Buffer.from(JSON.stringify(data)).toString('base64')
|
||||
}
|
||||
|
||||
function decodeCursor(cursor: string): CursorData | null {
|
||||
try {
|
||||
return JSON.parse(Buffer.from(cursor, 'base64').toString())
|
||||
} catch {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
export async function GET(request: NextRequest) {
|
||||
const requestId = generateId().slice(0, 8)
|
||||
|
||||
@@ -112,71 +97,22 @@ export async function GET(request: NextRequest) {
|
||||
)
|
||||
}
|
||||
|
||||
let scopeCondition: SQL<unknown>
|
||||
const scopeCondition = await buildOrgScopeCondition(orgMemberIds, params.includeDeparted)
|
||||
const filterConditions = buildFilterConditions({
|
||||
action: params.action,
|
||||
resourceType: params.resourceType,
|
||||
resourceId: params.resourceId,
|
||||
workspaceId: params.workspaceId,
|
||||
actorId: params.actorId,
|
||||
startDate: params.startDate,
|
||||
endDate: params.endDate,
|
||||
})
|
||||
|
||||
if (params.includeDeparted) {
|
||||
const orgWorkspaces = await db
|
||||
.select({ id: workspace.id })
|
||||
.from(workspace)
|
||||
.where(inArray(workspace.ownerId, orgMemberIds))
|
||||
|
||||
const orgWorkspaceIds = orgWorkspaces.map((w) => w.id)
|
||||
|
||||
if (orgWorkspaceIds.length > 0) {
|
||||
scopeCondition = or(
|
||||
inArray(auditLog.actorId, orgMemberIds),
|
||||
inArray(auditLog.workspaceId, orgWorkspaceIds)
|
||||
)!
|
||||
} else {
|
||||
scopeCondition = inArray(auditLog.actorId, orgMemberIds)
|
||||
}
|
||||
} else {
|
||||
scopeCondition = inArray(auditLog.actorId, orgMemberIds)
|
||||
}
|
||||
|
||||
const conditions: SQL<unknown>[] = [scopeCondition]
|
||||
|
||||
if (params.action) conditions.push(eq(auditLog.action, params.action))
|
||||
if (params.resourceType) conditions.push(eq(auditLog.resourceType, params.resourceType))
|
||||
if (params.resourceId) conditions.push(eq(auditLog.resourceId, params.resourceId))
|
||||
if (params.workspaceId) conditions.push(eq(auditLog.workspaceId, params.workspaceId))
|
||||
if (params.actorId) conditions.push(eq(auditLog.actorId, params.actorId))
|
||||
if (params.startDate) conditions.push(gte(auditLog.createdAt, new Date(params.startDate)))
|
||||
if (params.endDate) conditions.push(lte(auditLog.createdAt, new Date(params.endDate)))
|
||||
|
||||
if (params.cursor) {
|
||||
const cursorData = decodeCursor(params.cursor)
|
||||
if (cursorData?.createdAt && cursorData.id) {
|
||||
const cursorDate = new Date(cursorData.createdAt)
|
||||
if (!Number.isNaN(cursorDate.getTime())) {
|
||||
conditions.push(
|
||||
or(
|
||||
lt(auditLog.createdAt, cursorDate),
|
||||
and(eq(auditLog.createdAt, cursorDate), lt(auditLog.id, cursorData.id))
|
||||
)!
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const rows = await db
|
||||
.select()
|
||||
.from(auditLog)
|
||||
.where(and(...conditions))
|
||||
.orderBy(desc(auditLog.createdAt), desc(auditLog.id))
|
||||
.limit(params.limit + 1)
|
||||
|
||||
const hasMore = rows.length > params.limit
|
||||
const data = rows.slice(0, params.limit)
|
||||
|
||||
let nextCursor: string | undefined
|
||||
if (hasMore && data.length > 0) {
|
||||
const last = data[data.length - 1]
|
||||
nextCursor = encodeCursor({
|
||||
createdAt: last.createdAt.toISOString(),
|
||||
id: last.id,
|
||||
})
|
||||
}
|
||||
const { data, nextCursor } = await queryAuditLogs(
|
||||
[scopeCondition, ...filterConditions],
|
||||
params.limit,
|
||||
params.cursor
|
||||
)
|
||||
|
||||
const formattedLogs = data.map(formatAuditLogEntry)
|
||||
|
||||
|
||||
@@ -142,6 +142,7 @@ export async function DELETE(request: NextRequest, { params }: FileRouteParams)
|
||||
resourceId: fileId,
|
||||
resourceName: fileRecord.name,
|
||||
description: `Archived file "${fileRecord.name}" via API`,
|
||||
metadata: { fileSize: fileRecord.size, fileType: fileRecord.type },
|
||||
request,
|
||||
})
|
||||
|
||||
|
||||
@@ -155,6 +155,7 @@ export async function POST(request: NextRequest) {
|
||||
resourceId: userFile.id,
|
||||
resourceName: file.name,
|
||||
description: `Uploaded file "${file.name}" via API`,
|
||||
metadata: { fileSize: file.size, fileType: file.type || 'application/octet-stream' },
|
||||
request,
|
||||
})
|
||||
|
||||
|
||||
@@ -167,6 +167,7 @@ export async function DELETE(request: NextRequest, { params }: DocumentDetailRou
|
||||
resourceId: documentId,
|
||||
resourceName: docs[0].filename,
|
||||
description: `Deleted document "${docs[0].filename}" from knowledge base via API`,
|
||||
metadata: { knowledgeBaseId },
|
||||
request,
|
||||
})
|
||||
|
||||
|
||||
@@ -207,6 +207,7 @@ export async function POST(request: NextRequest, { params }: DocumentsRouteParam
|
||||
resourceId: newDocument.id,
|
||||
resourceName: file.name,
|
||||
description: `Uploaded document "${file.name}" to knowledge base via API`,
|
||||
metadata: { knowledgeBaseId, fileSize: file.size, mimeType: contentType },
|
||||
request,
|
||||
})
|
||||
|
||||
|
||||
@@ -111,6 +111,7 @@ export async function PUT(request: NextRequest, { params }: KnowledgeRouteParams
|
||||
resourceId: id,
|
||||
resourceName: updatedKb.name,
|
||||
description: `Updated knowledge base "${updatedKb.name}" via API`,
|
||||
metadata: { updatedFields: Object.keys(updates) },
|
||||
request,
|
||||
})
|
||||
|
||||
|
||||
@@ -106,6 +106,7 @@ export async function POST(request: NextRequest) {
|
||||
resourceId: kb.id,
|
||||
resourceName: kb.name,
|
||||
description: `Created knowledge base "${kb.name}" via API`,
|
||||
metadata: { chunkingConfig },
|
||||
request,
|
||||
})
|
||||
|
||||
|
||||
@@ -206,6 +206,7 @@ export async function POST(request: NextRequest) {
|
||||
resourceId: table.id,
|
||||
resourceName: table.name,
|
||||
description: `Created table "${table.name}" via API`,
|
||||
metadata: { columnCount: params.schema.columns.length },
|
||||
request,
|
||||
})
|
||||
|
||||
|
||||
@@ -270,8 +270,14 @@ export async function DELETE(
|
||||
resourceType: AuditResourceType.WEBHOOK,
|
||||
resourceId: id,
|
||||
resourceName: foundWebhook.provider || 'generic',
|
||||
description: 'Deleted webhook',
|
||||
metadata: { workflowId: webhookData.workflow.id },
|
||||
description: `Deleted ${foundWebhook.provider || 'generic'} webhook`,
|
||||
metadata: {
|
||||
provider: foundWebhook.provider || 'generic',
|
||||
workflowId: webhookData.workflow.id,
|
||||
webhookPath: foundWebhook.path || undefined,
|
||||
blockId: foundWebhook.blockId || undefined,
|
||||
credentialSetId: credentialSetId || undefined,
|
||||
},
|
||||
request,
|
||||
})
|
||||
|
||||
|
||||
@@ -687,7 +687,12 @@ export async function POST(request: NextRequest) {
|
||||
resourceId: savedWebhook.id,
|
||||
resourceName: provider || 'generic',
|
||||
description: `Created ${provider || 'generic'} webhook`,
|
||||
metadata: { provider, workflowId },
|
||||
metadata: {
|
||||
provider: provider || 'generic',
|
||||
workflowId,
|
||||
webhookPath: finalPath,
|
||||
blockId: blockId || undefined,
|
||||
},
|
||||
request,
|
||||
})
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user