Skip to content

Commit cae0e85

Browse files
authored
v0.4.3: posthog, docs updates, search modal improvements
2 parents 745eaff + fa9c978 commit cae0e85

File tree

50 files changed

+1863
-932
lines changed

Some content is hidden

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

50 files changed

+1863
-932
lines changed

apps/docs/app/[lang]/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { ReactNode } from 'react'
22
import { defineI18nUI } from 'fumadocs-ui/i18n'
33
import { DocsLayout } from 'fumadocs-ui/layouts/docs'
4-
import { RootProvider } from 'fumadocs-ui/provider'
4+
import { RootProvider } from 'fumadocs-ui/provider/next'
55
import { ExternalLink, GithubIcon } from 'lucide-react'
66
import { Inter } from 'next/font/google'
77
import Image from 'next/image'

apps/docs/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
"@vercel/analytics": "1.5.0",
1616
"@vercel/og": "^0.6.5",
1717
"clsx": "^2.1.1",
18-
"fumadocs-core": "^15.7.5",
19-
"fumadocs-mdx": "^11.5.6",
20-
"fumadocs-ui": "^15.7.5",
18+
"fumadocs-core": "15.8.2",
19+
"fumadocs-mdx": "11.10.1",
20+
"fumadocs-ui": "15.8.2",
2121
"lucide-react": "^0.511.0",
2222
"next": "15.4.1",
2323
"next-themes": "^0.4.6",

apps/sim/.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Database (Required)
22
DATABASE_URL="postgresql://postgres:password@localhost:5432/postgres"
3+
# DATABASE_SSL=disable # Optional: SSL mode (disable, prefer, require, verify-ca, verify-full)
4+
# DATABASE_SSL_CA= # Optional: Base64-encoded CA certificate (required for verify-ca/verify-full)
5+
# To generate: cat your-ca.crt | base64 | tr -d '\n'
36

47
# PostgreSQL Port (Optional) - defaults to 5432 if not specified
58
# POSTGRES_PORT=5432

apps/sim/app/api/copilot/checkpoints/revert/route.test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ describe('Copilot Checkpoints Revert API Route', () => {
237237
parallels: {},
238238
isDeployed: true,
239239
deploymentStatuses: { production: 'deployed' },
240-
hasActiveWebhook: false,
241240
},
242241
}
243242

@@ -287,7 +286,6 @@ describe('Copilot Checkpoints Revert API Route', () => {
287286
parallels: {},
288287
isDeployed: true,
289288
deploymentStatuses: { production: 'deployed' },
290-
hasActiveWebhook: false,
291289
lastSaved: 1640995200000,
292290
},
293291
},
@@ -309,7 +307,6 @@ describe('Copilot Checkpoints Revert API Route', () => {
309307
parallels: {},
310308
isDeployed: true,
311309
deploymentStatuses: { production: 'deployed' },
312-
hasActiveWebhook: false,
313310
lastSaved: 1640995200000,
314311
}),
315312
}
@@ -445,7 +442,6 @@ describe('Copilot Checkpoints Revert API Route', () => {
445442
parallels: {},
446443
isDeployed: false,
447444
deploymentStatuses: {},
448-
hasActiveWebhook: false,
449445
lastSaved: 1640995200000,
450446
})
451447
})
@@ -722,7 +718,6 @@ describe('Copilot Checkpoints Revert API Route', () => {
722718
production: 'deployed',
723719
staging: 'pending',
724720
},
725-
hasActiveWebhook: true,
726721
deployedAt: '2024-01-01T10:00:00.000Z',
727722
},
728723
}
@@ -769,7 +764,6 @@ describe('Copilot Checkpoints Revert API Route', () => {
769764
production: 'deployed',
770765
staging: 'pending',
771766
},
772-
hasActiveWebhook: true,
773767
deployedAt: '2024-01-01T10:00:00.000Z',
774768
lastSaved: 1640995200000,
775769
})

apps/sim/app/api/copilot/checkpoints/revert/route.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ export async function POST(request: NextRequest) {
7373
parallels: checkpointState?.parallels || {},
7474
isDeployed: checkpointState?.isDeployed || false,
7575
deploymentStatuses: checkpointState?.deploymentStatuses || {},
76-
hasActiveWebhook: checkpointState?.hasActiveWebhook || false,
7776
lastSaved: Date.now(),
7877
// Only include deployedAt if it's a valid date string that can be converted
7978
...(checkpointState?.deployedAt &&
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import { type NextRequest, NextResponse } from 'next/server'
2+
import { env } from '@/lib/env'
3+
import { createLogger } from '@/lib/logs/console/logger'
4+
5+
const logger = createLogger('CopilotTrainingExamplesAPI')
6+
7+
export const runtime = 'nodejs'
8+
export const dynamic = 'force-dynamic'
9+
10+
export async function POST(request: NextRequest) {
11+
const baseUrl = env.AGENT_INDEXER_URL
12+
if (!baseUrl) {
13+
logger.error('Missing AGENT_INDEXER_URL environment variable')
14+
return NextResponse.json({ error: 'Missing AGENT_INDEXER_URL env' }, { status: 500 })
15+
}
16+
17+
const apiKey = env.AGENT_INDEXER_API_KEY
18+
if (!apiKey) {
19+
logger.error('Missing AGENT_INDEXER_API_KEY environment variable')
20+
return NextResponse.json({ error: 'Missing AGENT_INDEXER_API_KEY env' }, { status: 500 })
21+
}
22+
23+
try {
24+
const body = await request.json()
25+
26+
logger.info('Sending workflow example to agent indexer', {
27+
hasJsonField: typeof body?.json === 'string',
28+
})
29+
30+
const upstream = await fetch(`${baseUrl}/examples/add`, {
31+
method: 'POST',
32+
headers: {
33+
'Content-Type': 'application/json',
34+
'x-api-key': apiKey,
35+
},
36+
body: JSON.stringify(body),
37+
})
38+
39+
if (!upstream.ok) {
40+
const errorText = await upstream.text()
41+
logger.error('Agent indexer rejected the example', {
42+
status: upstream.status,
43+
error: errorText,
44+
})
45+
return NextResponse.json({ error: errorText }, { status: upstream.status })
46+
}
47+
48+
const data = await upstream.json()
49+
logger.info('Successfully sent workflow example to agent indexer')
50+
51+
return NextResponse.json(data, {
52+
headers: { 'content-type': 'application/json' },
53+
})
54+
} catch (err) {
55+
const errorMessage = err instanceof Error ? err.message : 'Failed to add example'
56+
logger.error('Failed to send workflow example', { error: err })
57+
return NextResponse.json({ error: errorMessage }, { status: 502 })
58+
}
59+
}

apps/sim/app/api/logs/route.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,13 @@ export async function GET(request: NextRequest) {
9797
const baseQuery = db
9898
.select(selectColumns)
9999
.from(workflowExecutionLogs)
100-
.innerJoin(workflow, eq(workflowExecutionLogs.workflowId, workflow.id))
100+
.innerJoin(
101+
workflow,
102+
and(
103+
eq(workflowExecutionLogs.workflowId, workflow.id),
104+
eq(workflow.workspaceId, params.workspaceId)
105+
)
106+
)
101107
.innerJoin(
102108
permissions,
103109
and(
@@ -107,8 +113,8 @@ export async function GET(request: NextRequest) {
107113
)
108114
)
109115

110-
// Build conditions for the joined query
111-
let conditions: SQL | undefined = eq(workflow.workspaceId, params.workspaceId)
116+
// Build additional conditions for the query
117+
let conditions: SQL | undefined
112118

113119
// Filter by level
114120
if (params.level && params.level !== 'all') {
@@ -180,7 +186,13 @@ export async function GET(request: NextRequest) {
180186
const countQuery = db
181187
.select({ count: sql<number>`count(*)` })
182188
.from(workflowExecutionLogs)
183-
.innerJoin(workflow, eq(workflowExecutionLogs.workflowId, workflow.id))
189+
.innerJoin(
190+
workflow,
191+
and(
192+
eq(workflowExecutionLogs.workflowId, workflow.id),
193+
eq(workflow.workspaceId, params.workspaceId)
194+
)
195+
)
184196
.innerJoin(
185197
permissions,
186198
and(

apps/sim/app/api/users/me/settings/route.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ export async function GET() {
7676
telemetryEnabled: userSettings.telemetryEnabled,
7777
emailPreferences: userSettings.emailPreferences ?? {},
7878
billingUsageNotificationsEnabled: userSettings.billingUsageNotificationsEnabled ?? true,
79+
showFloatingControls: userSettings.showFloatingControls ?? true,
80+
showTrainingControls: userSettings.showTrainingControls ?? false,
7981
},
8082
},
8183
{ status: 200 }

apps/sim/app/api/v1/logs/route.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,13 @@ export async function GET(request: NextRequest) {
124124
workflowDescription: workflow.description,
125125
})
126126
.from(workflowExecutionLogs)
127-
.innerJoin(workflow, eq(workflowExecutionLogs.workflowId, workflow.id))
127+
.innerJoin(
128+
workflow,
129+
and(
130+
eq(workflowExecutionLogs.workflowId, workflow.id),
131+
eq(workflow.workspaceId, params.workspaceId)
132+
)
133+
)
128134
.innerJoin(
129135
permissions,
130136
and(

apps/sim/app/api/workflows/[id]/deployments/[version]/revert/route.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ export async function POST(
7676
isDeployed: true,
7777
deployedAt: new Date(),
7878
deploymentStatuses: deployedState.deploymentStatuses || {},
79-
hasActiveWebhook: deployedState.hasActiveWebhook || false,
8079
})
8180

8281
if (!saveResult.success) {

0 commit comments

Comments
 (0)