Skip to content

Commit fd6d927

Browse files
authored
v0.3.40: copilot improvements, knowledgebase improvements, security improvements, billing fixes
2 parents ed9b9ad + 6ac59a3 commit fd6d927

File tree

283 files changed

+28850
-10063
lines changed

Some content is hidden

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

283 files changed

+28850
-10063
lines changed

.devcontainer/docker-compose.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ services:
99
command: sleep infinity
1010
environment:
1111
- NODE_ENV=development
12-
- DATABASE_URL=postgresql://postgres:postgres@db:5432/simstudio
13-
- POSTGRES_URL=postgresql://postgres:postgres@db:5432/simstudio
12+
- DATABASE_URL=postgresql://postgres:postgres@db:${POSTGRES_PORT:-5432}/simstudio
13+
- POSTGRES_URL=postgresql://postgres:postgres@db:${POSTGRES_PORT:-5432}/simstudio
1414
- BETTER_AUTH_URL=http://localhost:3000
1515
- NEXT_PUBLIC_APP_URL=http://localhost:3000
1616
- BUN_INSTALL_CACHE_DIR=/home/bun/.bun/cache
@@ -39,7 +39,7 @@ services:
3939
command: sleep infinity
4040
environment:
4141
- NODE_ENV=development
42-
- DATABASE_URL=postgresql://postgres:postgres@db:5432/simstudio
42+
- DATABASE_URL=postgresql://postgres:postgres@db:${POSTGRES_PORT:-5432}/simstudio
4343
- BETTER_AUTH_URL=http://localhost:3000
4444
- NEXT_PUBLIC_APP_URL=http://localhost:3000
4545
depends_on:
@@ -60,7 +60,7 @@ services:
6060
context: ..
6161
dockerfile: docker/db.Dockerfile
6262
environment:
63-
- DATABASE_URL=postgresql://postgres:postgres@db:5432/simstudio
63+
- DATABASE_URL=postgresql://postgres:postgres@db:${POSTGRES_PORT:-5432}/simstudio
6464
depends_on:
6565
db:
6666
condition: service_healthy
@@ -77,7 +77,7 @@ services:
7777
- POSTGRES_PASSWORD=postgres
7878
- POSTGRES_DB=simstudio
7979
ports:
80-
- "5432:5432"
80+
- "${POSTGRES_PORT:-5432}:5432"
8181
healthcheck:
8282
test: ["CMD-SHELL", "pg_isready -U postgres"]
8383
interval: 5s

.github/workflows/trigger-deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ jobs:
3535
- name: Deploy to Staging
3636
if: github.ref == 'refs/heads/staging'
3737
working-directory: ./apps/sim
38-
run: npx --yes trigger.dev@4.0.0 deploy -e staging
38+
run: npx --yes trigger.dev@4.0.1 deploy -e staging
3939

4040
- name: Deploy to Production
4141
if: github.ref == 'refs/heads/main'
4242
working-directory: ./apps/sim
43-
run: npx --yes trigger.dev@4.0.0 deploy
43+
run: npx --yes trigger.dev@4.0.1 deploy
4444

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ Copilot is a Sim-managed service. To use Copilot on a self-hosted instance:
160160

161161
- Go to https://sim.ai → Settings → Copilot and generate a Copilot API key
162162
- Set `COPILOT_API_KEY` in your self-hosted environment to that value
163-
- Host Sim on a publicly available DNS and set NEXT_PUBLIC_APP_URL and BETTER_AUTH_URL to that value ([ngrok](https://ngrok.com/))
164163

165164
## Tech Stack
166165

apps/docs/content/docs/copilot/index.mdx

Lines changed: 45 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import { Callout } from 'fumadocs-ui/components/callout'
77
import { Card, Cards } from 'fumadocs-ui/components/card'
88
import { MessageCircle, Package, Zap, Infinity as InfinityIcon, Brain, BrainCircuit } from 'lucide-react'
99

10-
## What is Copilot
11-
1210
Copilot is your in-editor assistant that helps you build, understand, and improve workflows. It can:
1311

1412
- **Explain**: Answer questions about Sim and your current workflow
@@ -18,80 +16,79 @@ Copilot is your in-editor assistant that helps you build, understand, and improv
1816
<Callout type="info">
1917
Copilot is a Sim-managed service. For self-hosted deployments, generate a Copilot API key in the hosted app (sim.ai → Settings → Copilot)
2018
1. Go to [sim.ai](https://sim.ai) → Settings → Copilot and generate a Copilot API key
21-
2. Set `COPILOT_API_KEY` in your self-hosted environment to that value
22-
3. Host Sim on a publicly available DNS and set `NEXT_PUBLIC_APP_URL` and `BETTER_AUTH_URL` to that value (e.g., using ngrok)
19+
2. Set `COPILOT_API_KEY` in your self-hosted environment to that value
2320
</Callout>
2421

2522
## Modes
2623

2724
<Cards>
28-
<Card title="Ask">
29-
<div className="flex items-start gap-3">
30-
<span className="mt-0.5 inline-flex h-8 w-8 items-center justify-center rounded-md border border-border/50 bg-muted/60">
25+
<Card
26+
title={
27+
<span className="inline-flex items-center gap-2">
3128
<MessageCircle className="h-4 w-4 text-muted-foreground" />
29+
Ask
3230
</span>
33-
<div>
34-
<p className="m-0 text-sm">
35-
Q&A mode for explanations, guidance, and suggestions without making changes to your workflow.
36-
</p>
37-
</div>
31+
}
32+
>
33+
<div className="m-0 text-sm">
34+
Q&A mode for explanations, guidance, and suggestions without making changes to your workflow.
3835
</div>
3936
</Card>
40-
<Card title="Agent">
41-
<div className="flex items-start gap-3">
42-
<span className="mt-0.5 inline-flex h-8 w-8 items-center justify-center rounded-md border border-border/50 bg-muted/60">
37+
<Card
38+
title={
39+
<span className="inline-flex items-center gap-2">
4340
<Package className="h-4 w-4 text-muted-foreground" />
41+
Agent
4442
</span>
45-
<div>
46-
<p className="m-0 text-sm">
47-
Build-and-edit mode. Copilot proposes specific edits (add blocks, wire variables, tweak settings) and applies them when you approve.
48-
</p>
49-
</div>
43+
}
44+
>
45+
<div className="m-0 text-sm">
46+
Build-and-edit mode. Copilot proposes specific edits (add blocks, wire variables, tweak settings) and applies them when you approve.
5047
</div>
5148
</Card>
5249
</Cards>
5350

5451
## Depth Levels
5552

5653
<Cards>
57-
<Card title="Fast">
58-
<div className="flex items-start gap-3">
59-
<span className="mt-0.5 inline-flex h-8 w-8 items-center justify-center rounded-md border border-border/50 bg-muted/60">
54+
<Card
55+
title={
56+
<span className="inline-flex items-center gap-2">
6057
<Zap className="h-4 w-4 text-muted-foreground" />
58+
Fast
6159
</span>
62-
<div>
63-
<p className="m-0 text-sm">Quickest and cheapest. Best for small edits, simple workflows, and minor tweaks.</p>
64-
</div>
65-
</div>
60+
}
61+
>
62+
<div className="m-0 text-sm">Quickest and cheapest. Best for small edits, simple workflows, and minor tweaks.</div>
6663
</Card>
67-
<Card title="Auto">
68-
<div className="flex items-start gap-3">
69-
<span className="mt-0.5 inline-flex h-8 w-8 items-center justify-center rounded-md border border-border/50 bg-muted/60">
64+
<Card
65+
title={
66+
<span className="inline-flex items-center gap-2">
7067
<InfinityIcon className="h-4 w-4 text-muted-foreground" />
68+
Auto
7169
</span>
72-
<div>
73-
<p className="m-0 text-sm">Balanced speed and reasoning. Recommended default for most tasks.</p>
74-
</div>
75-
</div>
70+
}
71+
>
72+
<div className="m-0 text-sm">Balanced speed and reasoning. Recommended default for most tasks.</div>
7673
</Card>
77-
<Card title="Pro">
78-
<div className="flex items-start gap-3">
79-
<span className="mt-0.5 inline-flex h-8 w-8 items-center justify-center rounded-md border border-border/50 bg-muted/60">
74+
<Card
75+
title={
76+
<span className="inline-flex items-center gap-2">
8077
<Brain className="h-4 w-4 text-muted-foreground" />
78+
Advanced
8179
</span>
82-
<div>
83-
<p className="m-0 text-sm">More reasoning for larger workflows and complex edits while staying performant.</p>
84-
</div>
85-
</div>
80+
}
81+
>
82+
<div className="m-0 text-sm">More reasoning for larger workflows and complex edits while staying performant.</div>
8683
</Card>
87-
<Card title="Max">
88-
<div className="flex items-start gap-3">
89-
<span className="mt-0.5 inline-flex h-8 w-8 items-center justify-center rounded-md border border-border/50 bg-muted/60">
84+
<Card
85+
title={
86+
<span className="inline-flex items-center gap-2">
9087
<BrainCircuit className="h-4 w-4 text-muted-foreground" />
88+
Behemoth
9189
</span>
92-
<div>
93-
<p className="m-0 text-sm">Maximum reasoning for deep planning, debugging, and complex architectural changes.</p>
94-
</div>
95-
</div>
90+
}
91+
>
92+
<div className="m-0 text-sm">Maximum reasoning for deep planning, debugging, and complex architectural changes.</div>
9693
</Card>
9794
</Cards>

apps/docs/content/docs/tools/microsoft_excel.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Read data from a Microsoft Excel spreadsheet
109109
| Parameter | Type | Required | Description |
110110
| --------- | ---- | -------- | ----------- |
111111
| `spreadsheetId` | string | Yes | The ID of the spreadsheet to read from |
112-
| `range` | string | No | The range of cells to read from |
112+
| `range` | string | No | The range of cells to read from. Accepts "SheetName!A1:B2" for explicit ranges or just "SheetName" to read the used range of that sheet. If omitted, reads the used range of the first sheet. |
113113

114114
#### Output
115115

apps/docs/content/docs/tools/onedrive.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Upload a file to OneDrive
6868
| `fileName` | string | Yes | The name of the file to upload |
6969
| `content` | string | Yes | The content of the file to upload |
7070
| `folderSelector` | string | No | Select the folder to upload the file to |
71-
| `folderId` | string | No | The ID of the folder to upload the file to \(internal use\) |
71+
| `manualFolderId` | string | No | Manually entered folder ID \(advanced mode\) |
7272

7373
#### Output
7474

@@ -87,7 +87,7 @@ Create a new folder in OneDrive
8787
| --------- | ---- | -------- | ----------- |
8888
| `folderName` | string | Yes | Name of the folder to create |
8989
| `folderSelector` | string | No | Select the parent folder to create the folder in |
90-
| `folderId` | string | No | ID of the parent folder \(internal use\) |
90+
| `manualFolderId` | string | No | Manually entered parent folder ID \(advanced mode\) |
9191

9292
#### Output
9393

@@ -105,7 +105,7 @@ List files and folders in OneDrive
105105
| Parameter | Type | Required | Description |
106106
| --------- | ---- | -------- | ----------- |
107107
| `folderSelector` | string | No | Select the folder to list files from |
108-
| `folderId` | string | No | The ID of the folder to list files from \(internal use\) |
108+
| `manualFolderId` | string | No | The manually entered folder ID \(advanced mode\) |
109109
| `query` | string | No | A query to filter the files |
110110
| `pageSize` | number | No | The number of files to return |
111111

apps/docs/content/docs/tools/outlook.mdx

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,27 @@ Read emails from Outlook
211211

212212
| Parameter | Type | Description |
213213
| --------- | ---- | ----------- |
214-
| `success` | boolean | Email read operation success status |
215-
| `messageCount` | number | Number of emails retrieved |
216-
| `messages` | array | Array of email message objects |
217214
| `message` | string | Success or status message |
215+
| `results` | array | Array of email message objects |
216+
217+
### `outlook_forward`
218+
219+
Forward an existing Outlook message to specified recipients
220+
221+
#### Input
222+
223+
| Parameter | Type | Required | Description |
224+
| --------- | ---- | -------- | ----------- |
225+
| `messageId` | string | Yes | The ID of the message to forward |
226+
| `to` | string | Yes | Recipient email address\(es\), comma-separated |
227+
| `comment` | string | No | Optional comment to include with the forwarded message |
228+
229+
#### Output
230+
231+
| Parameter | Type | Description |
232+
| --------- | ---- | ----------- |
233+
| `message` | string | Success or error message |
234+
| `results` | object | Delivery result details |
218235

219236

220237

apps/sim/.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Database (Required)
22
DATABASE_URL="postgresql://postgres:password@localhost:5432/postgres"
33

4+
# PostgreSQL Port (Optional) - defaults to 5432 if not specified
5+
# POSTGRES_PORT=5432
6+
47
# Authentication (Required)
58
BETTER_AUTH_SECRET=your_secret_key # Use `openssl rand -hex 32` to generate, or visit https://www.better-auth.com/docs/installation
69
BETTER_AUTH_URL=http://localhost:3000

apps/sim/app/(auth)/login/login-form.tsx

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,12 @@ const PASSWORD_VALIDATIONS = {
4949
},
5050
}
5151

52-
// Validate callback URL to prevent open redirect vulnerabilities
5352
const validateCallbackUrl = (url: string): boolean => {
5453
try {
55-
// If it's a relative URL, it's safe
5654
if (url.startsWith('/')) {
5755
return true
5856
}
5957

60-
// If absolute URL, check if it belongs to the same origin
6158
const currentOrigin = typeof window !== 'undefined' ? window.location.origin : ''
6259
if (url.startsWith(currentOrigin)) {
6360
return true
@@ -70,7 +67,6 @@ const validateCallbackUrl = (url: string): boolean => {
7067
}
7168
}
7269

73-
// Validate password and return array of error messages
7470
const validatePassword = (passwordValue: string): string[] => {
7571
const errors: string[] = []
7672

@@ -475,6 +471,23 @@ export default function LoginPage({
475471
Sign up
476472
</Link>
477473
</div>
474+
475+
<div className='text-center text-neutral-500/80 text-xs leading-relaxed'>
476+
By signing in, you agree to our{' '}
477+
<Link
478+
href='/terms'
479+
className='text-neutral-400 underline-offset-4 transition hover:text-neutral-300 hover:underline'
480+
>
481+
Terms of Service
482+
</Link>{' '}
483+
and{' '}
484+
<Link
485+
href='/privacy'
486+
className='text-neutral-400 underline-offset-4 transition hover:text-neutral-300 hover:underline'
487+
>
488+
Privacy Policy
489+
</Link>
490+
</div>
478491
</div>
479492

480493
<Dialog open={forgotPasswordOpen} onOpenChange={setForgotPasswordOpen}>
@@ -504,9 +517,7 @@ export default function LoginPage({
504517
</div>
505518
{resetStatus.type && (
506519
<div
507-
className={`text-sm ${
508-
resetStatus.type === 'success' ? 'text-[#4CAF50]' : 'text-red-500'
509-
}`}
520+
className={`text-sm ${resetStatus.type === 'success' ? 'text-[#4CAF50]' : 'text-red-500'}`}
510521
>
511522
{resetStatus.message}
512523
</div>

apps/sim/app/(auth)/signup/signup-form.test.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import { act, fireEvent, render, screen, waitFor } from '@testing-library/react'
66
import { useRouter, useSearchParams } from 'next/navigation'
77
import { beforeEach, describe, expect, it, vi } from 'vitest'
8-
import { client } from '@/lib/auth-client'
8+
import { client, useSession } from '@/lib/auth-client'
99
import SignupPage from '@/app/(auth)/signup/signup-form'
1010

1111
vi.mock('next/navigation', () => ({
@@ -22,6 +22,7 @@ vi.mock('@/lib/auth-client', () => ({
2222
sendVerificationOtp: vi.fn(),
2323
},
2424
},
25+
useSession: vi.fn(),
2526
}))
2627

2728
vi.mock('@/app/(auth)/components/social-login-buttons', () => ({
@@ -43,6 +44,9 @@ describe('SignupPage', () => {
4344
vi.clearAllMocks()
4445
;(useRouter as any).mockReturnValue(mockRouter)
4546
;(useSearchParams as any).mockReturnValue(mockSearchParams)
47+
;(useSession as any).mockReturnValue({
48+
refetch: vi.fn().mockResolvedValue({}),
49+
})
4650
mockSearchParams.get.mockReturnValue(null)
4751
})
4852

0 commit comments

Comments
 (0)