Skip to content

feat(ee): add enterprise edition module structure - #3121

Merged
waleedlatif1 merged 1 commit into
stagingfrom
feat/ee
Feb 3, 2026
Merged

feat(ee): add enterprise edition module structure#3121
waleedlatif1 merged 1 commit into
stagingfrom
feat/ee

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Move EE features (SSO, Access Control, Credential Sets) to dedicated ee/ directory
  • Update all imports to reference @/ee/... directly
  • Remove wrapper/fallback patterns - EE is now required at build time
  • Follows Cal.com's open-core pattern

Type of Change

  • New feature

Testing

Build passes, tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercelBot commented Feb 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
ProjectDeploymentActionsUpdated (UTC)
docsSkippedSkippedFeb 3, 2026 7:34am

Request Review

@greptile-apps

greptile-appsBot commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

Greptile Overview

Greptile Summary

This PR moves enterprise features (SSO, access control/permission groups, credential sets) into a dedicated apps/sim/ee/ module and updates call sites across the app, API routes, copilot tools, and executor handlers to import from @/ee/... directly (removing prior wrapper/fallback patterns).

Most changes are path-only moves/renames with minimal logic churn. Notable behavior changes are limited to:

  • ee/index.ts now contains documentation suggesting EE is optional, which conflicts with the new static import model.
  • AccessControl’s handleOpenAddMembersModal callback dependency change may introduce a stale closure / dropped intended logic.
  • A new authorizeCredentialUse helper centralizes credential authorization; its internal JWT vs owner short-circuit behavior may be stricter than the docstring implies.

Confidence Score: 3/5

  • This PR is reasonably safe to merge, with a couple of small but real correctness/doc inconsistencies to address first.
  • Most changes are file moves and import rewrites; however, there is at least one behavior-affecting hook dependency change in AccessControl and a new credential authorization helper that could be overly strict for internal JWT callers. There is also misleading documentation in the EE barrel export about optional loading despite static imports.
  • apps/sim/ee/access-control/components/access-control.tsx, apps/sim/lib/credential-sets/credential-access.ts, apps/sim/ee/index.ts

Important Files Changed

FilenameOverview
apps/sim/app/(auth)/sso/page.tsxUpdated SSO page to import SSOForm from new EE path.
apps/sim/app/api/organizations/[id]/invitations/route.tsSwitched invitations permission-check imports to EE access-control module.
apps/sim/app/api/workspaces/invitations/route.test.tsUpdated test mock path for permission-check to new EE location.
apps/sim/app/api/workspaces/invitations/route.tsUpdated invitations route to import permission checks from EE module; removed comments only.
apps/sim/app/chat/[identifier]/chat.tsxMoved SSOAuth import from chat components barrel to direct EE SSOAuth import.
apps/sim/app/chat/components/index.tsRemoved SSOAuth export from chat components index as it moved to EE module.
apps/sim/app/workspace/[workspaceId]/knowledge/page.tsxUpdated getUserPermissionConfig import to EE permission-check module.
apps/sim/app/workspace/[workspaceId]/templates/page.tsxUpdated getUserPermissionConfig import to EE permission-check module.
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/credential-sets/credential-sets.tsxRemoved UI comments only; no functional changes detected.
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/index.tsStopped exporting AccessControl and SSO from settings-modal components barrel; moved to EE imports.
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/mcp/mcp.tsxRemoved comments only; no functional changes detected.
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/settings-modal.tsxUpdated settings modal to import AccessControl/SSO + SSO hooks from EE module and removed old barrel exports.
apps/sim/ee/LICENSEAdded EE license file defining enterprise subscription and restrictions.
apps/sim/ee/README.mdAdded EE readme describing required build-time EE directory and runtime env toggles.
apps/sim/ee/access-control/components/access-control.tsxMoved AccessControl UI to EE; changed some hook imports and adjusted callback dependencies (one potential stale closure issue).
apps/sim/ee/access-control/hooks/permission-groups.tsMoved permission-groups hooks to EE and added 'use client' directive.
apps/sim/ee/access-control/index.tsAdded access-control barrel exports for components, hooks, and permission-check utils.
apps/sim/ee/access-control/utils/permission-check.tsMoved permission-check utilities from executor to EE access-control module (no content changes shown).
apps/sim/ee/index.tsAdded EE root barrel export; contains misleading comment about optional loading vs static imports.
apps/sim/ee/sso/components/sso-auth.tsxMoved SSOAuth component to EE (no content changes shown).
apps/sim/ee/sso/components/sso-form.tsxMoved SSOForm component to EE (no content changes shown).
apps/sim/ee/sso/components/sso-login-button.tsxAdded reusable SSO login button gated by NEXT_PUBLIC_SSO_ENABLED.
apps/sim/ee/sso/components/sso-settings.tsxMoved SSO settings UI to EE; replaced local trusted providers list with shared SSO_TRUSTED_PROVIDERS and updated hook imports.
apps/sim/ee/sso/constants.tsMoved SSO trusted providers constants to EE and added doc comment.
apps/sim/ee/sso/hooks/sso.tsMoved SSO react-query hooks to EE and added 'use client' directive.
apps/sim/ee/sso/index.tsAdded SSO barrel exports for components/constants/hooks in EE.
apps/sim/executor/execution/block-executor.tsUpdated validateBlockType import to EE permission-check module.
apps/sim/executor/handlers/agent/agent-handler.tsUpdated permission validator imports to EE permission-check module.
apps/sim/executor/handlers/evaluator/evaluator-handler.tsUpdated validateModelProvider import to EE permission-check module.
apps/sim/executor/handlers/router/router-handler.tsUpdated validateModelProvider import to EE permission-check module.
apps/sim/hooks/queries/credential-sets.tsAdded 'use client' directive to credential-sets query hooks module.
apps/sim/hooks/use-permission-config.tsAdded 'use client' directive and switched to EE permission-groups hook import (prior thread noted duplication concerns).
apps/sim/lib/auth/auth.tsUpdated SSO trusted providers import to point at EE constants module.
apps/sim/lib/copilot/process-contents.tsUpdated getUserPermissionConfig import to EE permission-check module.
apps/sim/lib/copilot/tools/server/blocks/get-block-config.tsUpdated getUserPermissionConfig import to EE permission-check module.
apps/sim/lib/copilot/tools/server/blocks/get-block-options.tsUpdated getUserPermissionConfig import to EE permission-check module.
apps/sim/lib/copilot/tools/server/blocks/get-blocks-and-tools.tsUpdated getUserPermissionConfig import to EE permission-check module.
apps/sim/lib/copilot/tools/server/blocks/get-blocks-metadata-tool.tsUpdated getUserPermissionConfig import to EE permission-check module.
apps/sim/lib/copilot/tools/server/blocks/get-trigger-blocks.tsUpdated getUserPermissionConfig import to EE permission-check module.
apps/sim/lib/copilot/tools/server/workflow/edit-workflow.tsUpdated getUserPermissionConfig import to EE permission-check module.
apps/sim/lib/credential-sets/credential-access.tsAdded new centralized authZ helper for credential sets; internal_jwt vs owner short-circuit behavior may be overly strict.

Sequence Diagram

sequenceDiagram
autonumber
participant UI as UI (Next.js pages)
participant EE as Enterprise modules (@/ee)
participant API as Next.js Route Handlers
participant AC as Access Control utils/hooks
participant Auth as Auth/session
participant Exec as Executor (blocks/handlers)
UI->>EE: Import SSO/AccessControl/Credential Sets components
UI->>API: Call workspace/org invitation endpoints
API->>Auth: Resolve user/session
API->>AC: Check permissions / permission groups
AC-->>API: Allow/deny
API-->>UI: Invitation response
UI->>Exec: Trigger workflow execution
Exec->>EE: Load EE block/tool metadata (if referenced)
Exec-->>UI: Return execution output/status
Loading

@greptile-appsgreptile-appsBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

Comment threadapps/sim/ee/README.md Outdated
Comment threadapps/sim/hooks/use-permission-config.ts Outdated
@waleedlatif1

Copy link
Copy Markdown
CollaboratorAuthor

@greptile

@greptile-appsgreptile-appsBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

41 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

Comment threadapps/sim/ee/index.ts Outdated
Comment threadapps/sim/lib/credential-sets/credential-access.ts Outdated
@greptile-apps

Copy link
Copy Markdown
Contributor
Additional Comments (1)

apps/sim/ee/access-control/components/access-control.tsx
handleOpenAddMembersModal’s callback now has an empty dependency array, but it reads members (for existingMemberUserIds) in the previous version. If members is expected to affect modal state (e.g. to precompute/avoid re-adding existing members), removing this dependency can freeze behavior to the initial render or drop the intended logic.

If the existingMemberUserIds computation is truly unused, consider removing it entirely (including any downstream expectations). Otherwise, restore the dependency on members (and any derived values used in the callback).

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/ee/access-control/components/access-control.tsx
Line: 548:553
Comment:
`handleOpenAddMembersModal`’s callback now has an empty dependency array, but it reads `members` (for `existingMemberUserIds`) in the previous version. If `members` is expected to affect modal state (e.g. to precompute/avoid re-adding existing members), removing this dependency can freeze behavior to the initial render or drop the intended logic.
If the `existingMemberUserIds` computation is truly unused, consider removing it entirely (including any downstream expectations). Otherwise, restore the dependency on `members` (and any derived values used in the callback).
How can I resolve this? If you propose a fix, please make it concise.

Comment threadapps/sim/lib/credential-sets/credential-access.ts Outdated
Comment threadapps/sim/ee/sso/components/sso-login-button.tsx Outdated

@cursorcursorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Comment threadapps/sim/ee/sso/hooks/sso.ts
Comment threadapps/sim/ee/index.ts Outdated
@waleedlatif1
waleedlatif1 merged commit 9c3fd1f into stagingFeb 3, 2026
12 checks passed
@waleedlatif1
waleedlatif1 deleted the feat/ee branch February 3, 2026 07:40
waleedlatif1 added a commit that referenced this pull request Feb 3, 2026
waleedlatif1 added a commit that referenced this pull request Feb 3, 2026
…3118)
* fix(formatting): consolidate duration formatting into shared utility
* fix(formatting): preserve original precision and rounding behavior
* fix(logs): add precision to logs list duration formatting
* fix(formatting): use parseFloat to preserve fractional milliseconds
* feat(ee): add enterprise modules (#3121)
* fix(formatting): return null for missing values, strip trailing zeros
royceP2 pushed a commit to arenadeveloper02/p2-sim that referenced this pull request Mar 3, 2026
royceP2 pushed a commit to arenadeveloper02/p2-sim that referenced this pull request Mar 3, 2026
…imstudioai#3118)
* fix(formatting): consolidate duration formatting into shared utility
* fix(formatting): preserve original precision and rounding behavior
* fix(logs): add precision to logs list duration formatting
* fix(formatting): use parseFloat to preserve fractional milliseconds
* feat(ee): add enterprise modules (simstudioai#3121)
* fix(formatting): return null for missing values, strip trailing zeros
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@waleedlatif1