Skip to content

Commit 0b9019d

Browse files
authored
v0.6.23: MCP fixes, remove local state in favor of server state, mothership workflow edits via sockets, ui improvements
2 parents e8f7fe0 + 6d00d6b commit 0b9019d

File tree

72 files changed

+794
-1708
lines changed

Some content is hidden

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

72 files changed

+794
-1708
lines changed

apps/sim/app/_styles/globals.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* @see stores/constants.ts for the source of truth
1111
*/
1212
:root {
13-
--sidebar-width: 248px; /* SIDEBAR_WIDTH.DEFAULT */
13+
--sidebar-width: 0px; /* 0 outside workspace; blocking script always sets actual value on workspace pages */
1414
--panel-width: 320px; /* PANEL_WIDTH.DEFAULT */
1515
--toolbar-triggers-height: 300px; /* TOOLBAR_TRIGGERS_HEIGHT.DEFAULT */
1616
--editor-connections-height: 172px; /* EDITOR_CONNECTIONS_HEIGHT.DEFAULT */

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

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,6 @@ describe('Copilot Checkpoints Revert API Route', () => {
304304
loops: {},
305305
parallels: {},
306306
isDeployed: true,
307-
deploymentStatuses: { production: 'deployed' },
308307
},
309308
}
310309

@@ -349,7 +348,6 @@ describe('Copilot Checkpoints Revert API Route', () => {
349348
loops: {},
350349
parallels: {},
351350
isDeployed: true,
352-
deploymentStatuses: { production: 'deployed' },
353351
lastSaved: 1640995200000,
354352
},
355353
},
@@ -370,7 +368,6 @@ describe('Copilot Checkpoints Revert API Route', () => {
370368
loops: {},
371369
parallels: {},
372370
isDeployed: true,
373-
deploymentStatuses: { production: 'deployed' },
374371
lastSaved: 1640995200000,
375372
}),
376373
}
@@ -473,7 +470,6 @@ describe('Copilot Checkpoints Revert API Route', () => {
473470
edges: undefined,
474471
loops: null,
475472
parallels: undefined,
476-
deploymentStatuses: null,
477473
},
478474
}
479475

@@ -508,7 +504,6 @@ describe('Copilot Checkpoints Revert API Route', () => {
508504
loops: {},
509505
parallels: {},
510506
isDeployed: false,
511-
deploymentStatuses: {},
512507
lastSaved: 1640995200000,
513508
})
514509
})
@@ -768,10 +763,6 @@ describe('Copilot Checkpoints Revert API Route', () => {
768763
parallel1: { branches: ['branch1', 'branch2'] },
769764
},
770765
isDeployed: true,
771-
deploymentStatuses: {
772-
production: 'deployed',
773-
staging: 'pending',
774-
},
775766
deployedAt: '2024-01-01T10:00:00.000Z',
776767
},
777768
}
@@ -816,10 +807,6 @@ describe('Copilot Checkpoints Revert API Route', () => {
816807
parallel1: { branches: ['branch1', 'branch2'] },
817808
},
818809
isDeployed: true,
819-
deploymentStatuses: {
820-
production: 'deployed',
821-
staging: 'pending',
822-
},
823810
deployedAt: '2024-01-01T10:00:00.000Z',
824811
lastSaved: 1640995200000,
825812
})

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ export async function POST(request: NextRequest) {
8282
loops: checkpointState?.loops || {},
8383
parallels: checkpointState?.parallels || {},
8484
isDeployed: checkpointState?.isDeployed || false,
85-
deploymentStatuses: checkpointState?.deploymentStatuses || {},
8685
lastSaved: Date.now(),
8786
...(checkpointState?.deployedAt &&
8887
checkpointState.deployedAt !== null &&

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
@@ -79,7 +79,6 @@ export async function POST(
7979
loops: deployedState.loops || {},
8080
parallels: deployedState.parallels || {},
8181
lastSaved: Date.now(),
82-
deploymentStatuses: deployedState.deploymentStatuses || {},
8382
})
8483

8584
if (!saveResult.success) {

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ export async function GET(request: NextRequest, { params }: { params: Promise<{
8989
const finalWorkflowData = {
9090
...workflowData,
9191
state: {
92-
deploymentStatuses: {},
9392
blocks: normalizedData.blocks,
9493
edges: normalizedData.edges,
9594
loops: normalizedData.loops,
@@ -115,7 +114,6 @@ export async function GET(request: NextRequest, { params }: { params: Promise<{
115114
const emptyWorkflowData = {
116115
...workflowData,
117116
state: {
118-
deploymentStatuses: {},
119117
blocks: {},
120118
edges: [],
121119
loops: {},

apps/sim/app/api/workflows/[id]/variables/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { AuditAction, AuditResourceType, recordAudit } from '@/lib/audit/log'
88
import { checkSessionOrInternalAuth } from '@/lib/auth/hybrid'
99
import { generateRequestId } from '@/lib/core/utils/request'
1010
import { authorizeWorkflowByWorkspacePermission } from '@/lib/workflows/utils'
11-
import type { Variable } from '@/stores/panel/variables/types'
11+
import type { Variable } from '@/stores/variables/types'
1212

1313
const logger = createLogger('WorkflowVariablesAPI')
1414

apps/sim/app/layout.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ export default function RootLayout({ children }: { children: React.ReactNode })
9090
}
9191
9292
// Sidebar width
93+
var defaultSidebarWidth = '248px';
9394
try {
9495
var stored = localStorage.getItem('sidebar-state');
9596
if (stored) {
@@ -108,11 +109,15 @@ export default function RootLayout({ children }: { children: React.ReactNode })
108109
document.documentElement.style.setProperty('--sidebar-width', width + 'px');
109110
} else if (width > maxSidebarWidth) {
110111
document.documentElement.style.setProperty('--sidebar-width', maxSidebarWidth + 'px');
112+
} else {
113+
document.documentElement.style.setProperty('--sidebar-width', defaultSidebarWidth);
111114
}
112115
}
116+
} else {
117+
document.documentElement.style.setProperty('--sidebar-width', defaultSidebarWidth);
113118
}
114119
} catch (e) {
115-
// Fallback handled by CSS defaults
120+
document.documentElement.style.setProperty('--sidebar-width', defaultSidebarWidth);
116121
}
117122
118123
// Panel width and active tab

apps/sim/app/templates/components/template-card.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@ function normalizeWorkflowState(input?: any): WorkflowState | null {
108108
lastUpdate: input.lastUpdate,
109109
metadata: input.metadata,
110110
variables: input.variables,
111-
deploymentStatuses: input.deploymentStatuses,
112-
needsRedeployment: input.needsRedeployment,
113111
dragStartPosition: input.dragStartPosition ?? null,
114112
}
115113

apps/sim/app/workspace/[workspaceId]/components/oauth-modal.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
} from '@/components/emcn'
1717
import { client, useSession } from '@/lib/auth/auth-client'
1818
import type { OAuthReturnContext } from '@/lib/credentials/client-state'
19-
import { writeOAuthReturnContext } from '@/lib/credentials/client-state'
19+
import { ADD_CONNECTOR_SEARCH_PARAM, writeOAuthReturnContext } from '@/lib/credentials/client-state'
2020
import {
2121
getCanonicalScopesForProvider,
2222
getProviderIdFromServiceId,
@@ -59,8 +59,8 @@ type OAuthModalConnectProps = OAuthModalBaseProps & {
5959
workspaceId: string
6060
credentialCount: number
6161
} & (
62-
| { workflowId: string; knowledgeBaseId?: never }
63-
| { workflowId?: never; knowledgeBaseId: string }
62+
| { workflowId: string; knowledgeBaseId?: never; connectorType?: never }
63+
| { workflowId?: never; knowledgeBaseId: string; connectorType?: string }
6464
)
6565

6666
interface OAuthModalReauthorizeProps extends OAuthModalBaseProps {
@@ -81,6 +81,7 @@ export function OAuthModal(props: OAuthModalProps) {
8181
const workspaceId = isConnect ? props.workspaceId : ''
8282
const workflowId = isConnect ? props.workflowId : undefined
8383
const knowledgeBaseId = isConnect ? props.knowledgeBaseId : undefined
84+
const connectorType = isConnect ? props.connectorType : undefined
8485
const toolName = !isConnect ? props.toolName : ''
8586
const requiredScopes = !isConnect ? (props.requiredScopes ?? EMPTY_SCOPES) : EMPTY_SCOPES
8687
const newScopes = !isConnect ? (props.newScopes ?? EMPTY_SCOPES) : EMPTY_SCOPES
@@ -172,7 +173,7 @@ export function OAuthModal(props: OAuthModalProps) {
172173
}
173174

174175
const returnContext: OAuthReturnContext = knowledgeBaseId
175-
? { ...baseContext, origin: 'kb-connectors' as const, knowledgeBaseId }
176+
? { ...baseContext, origin: 'kb-connectors' as const, knowledgeBaseId, connectorType }
176177
: { ...baseContext, origin: 'workflow' as const, workflowId: workflowId! }
177178

178179
writeOAuthReturnContext(returnContext)
@@ -205,7 +206,11 @@ export function OAuthModal(props: OAuthModalProps) {
205206
return
206207
}
207208

208-
await client.oauth2.link({ providerId, callbackURL: window.location.href })
209+
const callbackURL = new URL(window.location.href)
210+
if (connectorType) {
211+
callbackURL.searchParams.set(ADD_CONNECTOR_SEARCH_PARAM, connectorType)
212+
}
213+
await client.oauth2.link({ providerId, callbackURL: callbackURL.toString() })
209214
handleClose()
210215
} catch (err) {
211216
logger.error('Failed to initiate OAuth connection', { error: err })

apps/sim/app/workspace/[workspaceId]/files/[fileId]/view/loading.tsx

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)