Skip to content

Commit 0f42820

Browse files
committed
fix: resolve merge conflicts with staging
2 parents dbabedd + 7f1efcc commit 0f42820

File tree

912 files changed

+69149
-8721
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

912 files changed

+69149
-8721
lines changed

.claude/rules/global.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,26 @@ Use TSDoc for documentation. No `====` separators. No non-TSDoc comments.
99
## Styling
1010
Never update global styles. Keep all styling local to components.
1111

12+
## ID Generation
13+
Never use `crypto.randomUUID()`, `nanoid`, or the `uuid` package directly. Use the utilities from `@/lib/core/utils/uuid`:
14+
15+
- `generateId()` — UUID v4, use by default
16+
- `generateShortId(size?)` — short URL-safe ID (default 21 chars), for compact identifiers
17+
18+
Both use `crypto.getRandomValues()` under the hood and work in all contexts including non-secure (HTTP) browsers.
19+
20+
```typescript
21+
// ✗ Bad
22+
import { nanoid } from 'nanoid'
23+
import { v4 as uuidv4 } from 'uuid'
24+
const id = crypto.randomUUID()
25+
26+
// ✓ Good
27+
import { generateId, generateShortId } from '@/lib/core/utils/uuid'
28+
const uuid = generateId()
29+
const shortId = generateShortId()
30+
const tiny = generateShortId(8)
31+
```
32+
1233
## Package Manager
1334
Use `bun` and `bunx`, not `npm` and `npx`.

.cursor/rules/global.mdc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,26 @@ Use TSDoc for documentation. No `====` separators. No non-TSDoc comments.
1616
## Styling
1717
Never update global styles. Keep all styling local to components.
1818

19+
## ID Generation
20+
Never use `crypto.randomUUID()`, `nanoid`, or the `uuid` package directly. Use the utilities from `@/lib/core/utils/uuid`:
21+
22+
- `generateId()` — UUID v4, use by default
23+
- `generateShortId(size?)` — short URL-safe ID (default 21 chars), for compact identifiers
24+
25+
Both use `crypto.getRandomValues()` under the hood and work in all contexts including non-secure (HTTP) browsers.
26+
27+
```typescript
28+
// ✗ Bad
29+
import { nanoid } from 'nanoid'
30+
import { v4 as uuidv4 } from 'uuid'
31+
const id = crypto.randomUUID()
32+
33+
// ✓ Good
34+
import { generateId, generateShortId } from '@/lib/core/utils/uuid'
35+
const uuid = generateId()
36+
const shortId = generateShortId()
37+
const tiny = generateShortId(8)
38+
```
39+
1940
## Package Manager
2041
Use `bun` and `bunx`, not `npm` and `npx`.

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ You are a professional software engineer. All code must follow best practices: a
77
- **Logging**: Import `createLogger` from `@sim/logger`. Use `logger.info`, `logger.warn`, `logger.error` instead of `console.log`
88
- **Comments**: Use TSDoc for documentation. No `====` separators. No non-TSDoc comments
99
- **Styling**: Never update global styles. Keep all styling local to components
10+
- **ID Generation**: Never use `crypto.randomUUID()`, `nanoid`, or `uuid` package. Use `generateId()` (UUID v4) or `generateShortId()` (compact) from `@/lib/core/utils/uuid`
1011
- **Package Manager**: Use `bun` and `bunx`, not `npm` and `npx`
1112

1213
## Architecture

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ You are a professional software engineer. All code must follow best practices: a
77
- **Logging**: Import `createLogger` from `@sim/logger`. Use `logger.info`, `logger.warn`, `logger.error` instead of `console.log`
88
- **Comments**: Use TSDoc for documentation. No `====` separators. No non-TSDoc comments
99
- **Styling**: Never update global styles. Keep all styling local to components
10+
- **ID Generation**: Never use `crypto.randomUUID()`, `nanoid`, or `uuid` package. Use `generateId()` (UUID v4) or `generateShortId()` (compact) from `@/lib/core/utils/uuid`
1011
- **Package Manager**: Use `bun` and `bunx`, not `npm` and `npx`
1112

1213
## Architecture

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ Sim also supports local models via [Ollama](https://ollama.ai) and [vLLM](https:
9090
git clone https://github.com/simstudioai/sim.git
9191
cd sim
9292
bun install
93+
bun run prepare # Set up pre-commit hooks
9394
```
9495

9596
2. Set up PostgreSQL with pgvector:
@@ -104,14 +105,19 @@ Or install manually via the [pgvector guide](https://github.com/pgvector/pgvecto
104105

105106
```bash
106107
cp apps/sim/.env.example apps/sim/.env
108+
# Create your secrets
109+
perl -i -pe "s/your_encryption_key/$(openssl rand -hex 32)/" apps/sim/.env
110+
perl -i -pe "s/your_internal_api_secret/$(openssl rand -hex 32)/" apps/sim/.env
111+
perl -i -pe "s/your_api_encryption_key/$(openssl rand -hex 32)/" apps/sim/.env
112+
# DB configs for migration
107113
cp packages/db/.env.example packages/db/.env
108114
# Edit both .env files to set DATABASE_URL="postgresql://postgres:your_password@localhost:5432/simstudio"
109115
```
110116

111117
4. Run migrations:
112118

113119
```bash
114-
cd packages/db && bunx drizzle-kit migrate --config=./drizzle.config.ts
120+
cd packages/db && bun run db:migrate
115121
```
116122

117123
5. Start development servers:

apps/docs/components/icons.tsx

Lines changed: 157 additions & 28 deletions
Large diffs are not rendered by default.

apps/docs/components/ui/icon-mapping.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import type { ComponentType, SVGProps } from 'react'
66
import {
77
A2AIcon,
8+
AgentMailIcon,
89
AhrefsIcon,
910
AirtableIcon,
1011
AirweaveIcon,
@@ -26,7 +27,9 @@ import {
2627
CirclebackIcon,
2728
ClayIcon,
2829
ClerkIcon,
30+
CloudFormationIcon,
2931
CloudflareIcon,
32+
CloudWatchIcon,
3033
ConfluenceIcon,
3134
CursorIcon,
3235
DatabricksIcon,
@@ -139,6 +142,7 @@ import {
139142
ResendIcon,
140143
RevenueCatIcon,
141144
RipplingIcon,
145+
RootlyIcon,
142146
S3Icon,
143147
SalesforceIcon,
144148
SearchIcon,
@@ -188,6 +192,7 @@ type IconComponent = ComponentType<SVGProps<SVGSVGElement>>
188192

189193
export const blockTypeToIconMap: Record<string, IconComponent> = {
190194
a2a: A2AIcon,
195+
agentmail: AgentMailIcon,
191196
ahrefs: AhrefsIcon,
192197
airtable: AirtableIcon,
193198
airweave: AirweaveIcon,
@@ -208,6 +213,8 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
208213
clay: ClayIcon,
209214
clerk: ClerkIcon,
210215
cloudflare: CloudflareIcon,
216+
cloudformation: CloudFormationIcon,
217+
cloudwatch: CloudWatchIcon,
211218
confluence_v2: ConfluenceIcon,
212219
cursor_v2: CursorIcon,
213220
databricks: DatabricksIcon,
@@ -320,6 +327,7 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
320327
resend: ResendIcon,
321328
revenuecat: RevenueCatIcon,
322329
rippling: RipplingIcon,
330+
rootly: RootlyIcon,
323331
s3: S3Icon,
324332
salesforce: SalesforceIcon,
325333
search: SearchIcon,

apps/docs/content/docs/de/blocks/guardrails.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Erkennt personenbezogene Daten mithilfe von Microsoft Presidio. Unterstützt üb
131131
**Anwendungsfälle:**
132132
- Blockieren von Inhalten mit sensiblen persönlichen Informationen
133133
- Maskieren von personenbezogenen Daten vor der Protokollierung oder Speicherung
134-
- Einhaltung der DSGVO, HIPAA und anderer Datenschutzbestimmungen
134+
- Einhaltung der DSGVO und anderer Datenschutzbestimmungen
135135
- Bereinigung von Benutzereingaben vor der Verarbeitung
136136

137137
## Konfiguration
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
---
2+
title: Credential
3+
---
4+
5+
import { Callout } from 'fumadocs-ui/components/callout'
6+
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
7+
import { Image } from '@/components/ui/image'
8+
import { FAQ } from '@/components/ui/faq'
9+
10+
The Credential block has two operations: **Select Credential** picks a single OAuth credential and outputs its ID reference for downstream blocks; **List Credentials** returns all OAuth credentials in the workspace (optionally filtered by provider) as an array for iteration.
11+
12+
<div className="flex justify-center">
13+
<Image
14+
src="/static/blocks/credential.png"
15+
alt="Credential Block"
16+
width={400}
17+
height={300}
18+
className="my-6"
19+
/>
20+
</div>
21+
22+
<Callout>
23+
The Credential block outputs credential **ID references**, not secrets. Downstream blocks receive the ID and resolve the actual OAuth token securely during their own execution.
24+
</Callout>
25+
26+
## Configuration Options
27+
28+
### Operation
29+
30+
| Value | Description |
31+
|---|---|
32+
| **Select Credential** | Pick one OAuth credential and output its reference — use this to wire a single credential into downstream blocks |
33+
| **List Credentials** | Return all OAuth credentials in the workspace as an array — use this with a ForEach loop |
34+
35+
### Credential (Select operation)
36+
37+
Select an OAuth credential from your workspace. The dropdown shows all connected OAuth accounts (Google, GitHub, Slack, etc.).
38+
39+
In advanced mode, paste a credential ID directly. You can copy a credential ID from your workspace's Credentials settings page.
40+
41+
### Provider (List operation)
42+
43+
Filter the returned OAuth credentials by provider. Select one or more providers from the dropdown — only providers you have credentials for will appear. Leave empty to return all OAuth credentials.
44+
45+
| Example | Returns |
46+
|---|---|
47+
| Gmail | Gmail credentials only |
48+
| Slack | Slack credentials only |
49+
| Gmail + Slack | Gmail and Slack credentials |
50+
51+
## Outputs
52+
53+
<Tabs items={['Select Credential', 'List Credentials']}>
54+
<Tab>
55+
| Output | Type | Description |
56+
|---|---|---|
57+
| `credentialId` | `string` | The credential ID — pipe this into other blocks' credential fields |
58+
| `displayName` | `string` | Human-readable name (e.g. "waleed@company.com") |
59+
| `providerId` | `string` | OAuth provider ID (e.g. `google-email`, `slack`) |
60+
</Tab>
61+
<Tab>
62+
| Output | Type | Description |
63+
|---|---|---|
64+
| `credentials` | `json` | Array of OAuth credential objects (see shape below) |
65+
| `count` | `number` | Number of credentials returned |
66+
67+
Each object in the `credentials` array:
68+
69+
| Field | Type | Description |
70+
|---|---|---|
71+
| `credentialId` | `string` | The credential ID |
72+
| `displayName` | `string` | Human-readable name |
73+
| `providerId` | `string` | OAuth provider ID |
74+
</Tab>
75+
</Tabs>
76+
77+
## Example Use Cases
78+
79+
**Shared credential across multiple blocks** — Define once, use everywhere
80+
```
81+
Credential (Select, Google) → Gmail (Send) & Google Drive (Upload) & Google Calendar (Create)
82+
```
83+
84+
**Multi-account workflows** — Route to different credentials based on logic
85+
```
86+
Agent (Determine account) → Condition → Credential A or Credential B → Slack (Post)
87+
```
88+
89+
**Iterate over all Gmail accounts**
90+
```
91+
Credential (List, Provider: Gmail) → ForEach Loop → Gmail (Send) using <loop.currentItem.credentialId>
92+
```
93+
94+
<div className="flex justify-center">
95+
<Image
96+
src="/static/blocks/credential-loop.png"
97+
alt="Credential List wired into a ForEach Loop"
98+
width={900}
99+
height={400}
100+
className="my-6"
101+
/>
102+
</div>
103+
104+
## How to wire a Credential block
105+
106+
### Select Credential
107+
108+
1. Drop a **Credential** block and select your OAuth credential from the picker
109+
2. In the downstream block, switch to **advanced mode** on its credential field
110+
3. Enter `<credentialBlockName.credentialId>` as the value
111+
112+
<Tabs items={['Gmail', 'Slack']}>
113+
<Tab>
114+
In the Gmail block's credential field (advanced mode):
115+
```
116+
<myCredential.credentialId>
117+
```
118+
</Tab>
119+
<Tab>
120+
In the Slack block's credential field (advanced mode):
121+
```
122+
<myCredential.credentialId>
123+
```
124+
</Tab>
125+
</Tabs>
126+
127+
### List Credentials
128+
129+
1. Drop a **Credential** block, set Operation to **List Credentials**
130+
2. Optionally select one or more **Providers** to narrow results (only your connected providers appear)
131+
3. Wire `<credentialBlockName.credentials>` into a **ForEach Loop** as the items source
132+
4. Inside the loop, reference `<loop.currentItem.credentialId>` in downstream blocks' credential fields
133+
134+
## Best Practices
135+
136+
- **Define once, reference many times**: When five blocks use the same Google account, use one Credential block and wire all five to `<credential.credentialId>` instead of selecting the account five times
137+
- **Outputs are safe to log**: The `credentialId` output is a UUID reference, not a secret. It is safe to inspect in execution logs
138+
- **Use for environment switching**: Pair with a Condition block to route to a production or staging OAuth credential based on a workflow variable
139+
- **Advanced mode is required**: Downstream blocks must be in advanced mode on their credential field to accept a dynamic reference
140+
- **Use List + ForEach for fan-out**: When you need to run the same action across all accounts of a provider, List Credentials feeds naturally into a ForEach loop
141+
- **Narrow by provider**: Use the Provider multiselect to filter to specific services — only providers you have credentials for are shown
142+
143+
<FAQ items={[
144+
{ question: "Does the Credential block expose my secret or token?", answer: "No. The block outputs a credential ID (a UUID), not the actual OAuth token. Downstream blocks receive the ID and resolve the token securely in their own execution context. Secrets never appear in workflow state, logs, or the canvas." },
145+
{ question: "What credential types does it support?", answer: "OAuth connected accounts only (Google, GitHub, Slack, etc.). Environment variables and service accounts cannot be resolved by ID in downstream blocks, so they are not supported." },
146+
{ question: "How is Select different from just copying a credential ID into advanced mode?", answer: "Functionally identical — both pass the same credential ID to the downstream block. The Credential block adds value when you need to use one credential in many blocks (change it once), or when you want to select between credentials dynamically using a Condition block." },
147+
{ question: "Can I list all OAuth credentials in my workspace?", answer: "Yes. Set the Operation to 'List Credentials'. Optionally filter by provider using the Provider multiselect. Wire the credentials output into a ForEach loop to process each credential individually." },
148+
{ question: "Can I use a Credential block output in a Function block?", answer: "Yes. Reference <credential.credentialId> in your Function block's code. Note that the function will receive the raw UUID string — if you need the resolved token, the downstream block must handle the resolution (as integration blocks do). The Function block does not automatically resolve credential IDs." },
149+
{ question: "What happens if the credential is deleted?", answer: "The Select operation will throw an error at execution time: 'Credential not found'. The List operation will simply omit the deleted credential from the results. Update the Credential block to select a valid credential before re-running." },
150+
]} />

apps/docs/content/docs/en/blocks/guardrails.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ Detects personally identifiable information using Microsoft Presidio. Supports o
132132
**Use Cases:**
133133
- Block content containing sensitive personal information
134134
- Mask PII before logging or storing data
135-
- Compliance with GDPR, HIPAA, and other privacy regulations
135+
- Compliance with GDPR and other privacy regulations
136136
- Sanitize user inputs before processing
137137

138138
## Configuration

0 commit comments

Comments
 (0)