Skip to content

feat(misc): skills import, MCP modal, workmark, dispatch modals, collapsed tasks and workflows manipulation, README#3777

Merged
waleedlatif1 merged 16 commits intostagingfrom
feat/misc-updates
Mar 26, 2026
Merged

feat(misc): skills import, MCP modal, workmark, dispatch modals, collapsed tasks and workflows manipulation, README#3777
waleedlatif1 merged 16 commits intostagingfrom
feat/misc-updates

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • skills import, MCP modal, workmark, dispatch modals, collapsed tasks and workflows manipulation, README

Type of Change

  • Bug fix
  • New feature

Testing

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
Copy link

vercel bot commented Mar 26, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Mar 26, 2026 2:58am

Request Review

@cursor
Copy link

cursor bot commented Mar 26, 2026

PR Summary

Medium Risk
Adds new authenticated API surfaces (skills GitHub fetch, mothership chat GET/PATCH/DELETE) and significant sidebar/integration UI refactors; primary risk is authorization/edge-case handling and behavior regressions in chat/task/integration flows.

Overview
Adds skill importing: new /api/skills/import endpoint fetches SKILL.md from GitHub (raw URL conversion, timeouts, 100KB limit) and a new Skills modal Import tab supporting drag/drop .md/.zip, GitHub URL fetch, or paste; includes parsing/ZIP extraction utilities and Vitest coverage.

Reworks chat/task APIs and UI behaviors: removes legacy rename/mark-read routes and introduces a consolidated mothership chat endpoint (/api/mothership/chats/[chatId]) with GET (optionally returns stream snapshot), PATCH (rename + unread state), and DELETE (publishes task events).

Improves credentials/integrations & MCP creation UX: integrations manager gets a two-step “connect integration” flow with scope display, available-integrations list, and uses useCreateCredentialDraft instead of manual fetch; workflow credential selectors now open an in-place ConnectCredentialModal (vs navigating to settings) and fetch inaccessible credential names via useWorkspaceCredential. MCP tools can now create MCP servers via an inline McpServerFormModal from deploy/tool pickers.

Sidebar/settings polish: adds richer collapsed sidebar flyouts (primary actions, inline rename helper, hover menu locking) and extends context menus with mark read/unread and optional delete; settings navigation adds showWhenLocked (e.g., show Max-only items with a badge) and renames collapsed tooltip prop. Minor UI tweaks include scrollbar gutter, credit/billing layout/button variants, and README branding/docs link updates.

Written by Cursor Bugbot for commit f475ae9. Configure here.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 26, 2026

Greptile Summary

This PR is a broad feature drop covering six main areas: skill import (file/ZIP/GitHub/paste), an inline MCP server creation modal in the deploy panel, a Wordmark icon + SVG assets, inline task/workflow manipulation from the collapsed sidebar (context menus, rename, mark read/unread), a refactored settings sidebar that hides rather than disables plan-gated items (with a "Max" badge for showWhenLocked items), and a new ConnectCredentialModal for inline OAuth credential creation. Previous review concerns (CRLF handling, ZIP size guard, concurrent-save race, isUnread silent-discard) are confirmed addressed.\n\nKey points:\n- The skills import pipeline is well-layered: client-side validation → server-side GitHub URL rewriting with a 15 s timeout and 100 KB cap → parseSkillMarkdown with CRLF normalization and unit tests.\n- useFlyoutInlineRename consolidates the old ad-hoc rename state into a reusable hook with a synchronous isSavingRef guard against double-invocation.\n- Task API calls are unified to the PATCH /api/mothership/chats/[chatId] endpoint; the now-deleted /api/copilot/chat/rename and /api/mothership/chats/read routes are superseded.\n- onSuccessonSettled in credential mutation hooks ensures query invalidation even on error, which is a correctness improvement.\n- Minor UX gap: the skill modal's Cancel button is absent when the Import tab is active.\n- zip.file(candidates[0])! non-null assertion in utils.ts is safe in practice but could be an explicit null check for clarity.

Confidence Score: 4/5

Safe to merge; all previously flagged blocking issues are resolved and remaining comments are non-blocking UX/style suggestions.

The PR addresses every prior P0/P1 concern (CRLF, ZIP bomb, double-save race, isUnread silent-discard). The new additions are well-structured with proper error handling, auth guards, and optimistic updates. The only open issues are a missing Cancel button on the skill import tab (cosmetic), an undocumented no-op delete handler in the collapsed workflow context menu (technical debt), and a non-null assertion that could be an explicit guard. None of these block correctness or security.

apps/sim/app/workspace/[workspaceId]/settings/components/skills/components/skill-modal.tsx (Cancel button on Import tab), apps/sim/app/workspace/[workspaceId]/settings/components/skills/components/utils.ts (non-null assertion)

Important Files Changed

Filename Overview
apps/sim/app/api/skills/import/route.ts New POST endpoint that fetches a SKILL.md from a GitHub URL, with proper auth, timeout (15s), size limits (100KB), and clear error handling for non-GitHub URLs and HTTP failures.
apps/sim/app/workspace/[workspaceId]/settings/components/skills/components/skill-modal.tsx Adds tabbed Create/Import UI to the skill modal; footer with Cancel button is hidden on the Import tab, leaving users without an explicit dismiss action there.
apps/sim/app/workspace/[workspaceId]/settings/components/skills/components/skill-import.tsx New component supporting three skill import paths (file upload/drop, GitHub URL fetch, paste); includes 5 MB ZIP guard and delegates content parsing to utils.
apps/sim/app/workspace/[workspaceId]/settings/components/skills/components/utils.ts Utility functions for SKILL.md parsing and ZIP extraction; CRLF normalization is included; non-null assertion on zip.file() could be replaced with an explicit null check.
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/sidebar.tsx Large refactor adding collapsed-state task/workflow context menus, inline rename via useFlyoutInlineRename, mark-as-read/unread actions, and a Wordmark in the expanded header; no-op delete handler on collapsed workflow context menu is intentional but undocumented.
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/hooks/use-flyout-inline-rename.ts New hook for inline rename with concurrent-invocation guard (isSavingRef), cancel/Escape support, and error recovery (resets value to original name on failure).
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/collapsed-sidebar-menu/collapsed-sidebar-menu.tsx Significant expansion adding CollapsedTaskFlyoutItem, CollapsedWorkflowFlyoutItem, and folder-recursive rename support; shared inputRef across instances is safe due to single-editing-target invariant.
apps/sim/hooks/queries/credentials.ts Adds useCreateCredentialDraft mutation and switches onSuccess to onSettled for cache invalidation in create/update/delete/member mutations, ensuring invalidation even on errors.
apps/sim/hooks/queries/tasks.ts Consolidates task API calls to the unified PATCH /api/mothership/chats/[chatId] REST resource; adds useMarkTaskUnread with optimistic update mirroring the existing useMarkTaskRead pattern.

Sequence Diagram

sequenceDiagram
    participant U as User
    participant SI as SkillImport (client)
    participant SR as /api/skills/import
    participant GH as GitHub (raw.githubusercontent.com)
    participant SM as SkillModal

    Note over U,SM: GitHub URL import path
    U->>SI: Enter GitHub URL + click Fetch
    SI->>SR: POST /api/skills/import { url }
    SR->>SR: toRawGitHubUrl() - rewrite blob to raw URL
    SR->>GH: GET raw file (timeout 15s, Accept: text/plain)
    GH-->>SR: file content
    SR->>SR: Check content-length and content.length <= 100KB
    SR-->>SI: { content }
    SI->>SI: parseSkillMarkdown(content)
    SI->>SM: onImport({ name, description, content })
    SM->>SM: setActiveTab('create') - switch to edit form

    Note over U,SM: File / ZIP drop path
    U->>SI: Drop .md or .zip file
    SI->>SI: isAcceptedFile() + size check (ZIP <= 5MB)
    SI->>SI: extractSkillFromZip() or file.text()
    SI->>SI: parseSkillMarkdown()
    SI->>SM: onImport({ name, description, content })
Loading

Reviews (4): Last reviewed commit: "fix(skills): normalize CRLF line endings..." | Re-trigger Greptile

…rovements

- Add skills import functionality (route + components + utils)
- Update MCP deploy modal
- Add Wordmark emcn icon + logo SVG assets
- Improve tool-input component
- Update README branding to new wordmark
- Add ban-spam-accounts admin script
- Add BUILT_IN_TOOL_TYPES export to blocks/utils.ts (was removed from
  tool-input.tsx but never added to the new import target — caused build
  error "Export BUILT_IN_TOOL_TYPES doesn't exist in target module")
- Export Wordmark from emcn icons barrel (index.ts)
- Derive isDragging from dragCounter in skill-import.tsx instead of
  maintaining redundant state that could desync
- Replace manual AbortController/setTimeout with AbortSignal.timeout()
  in skills import API route (Node 17.3+ supported, cleaner no-cleanup)
- Use useId() for SVG gradient ID in wordmark.tsx to prevent duplicate
  ID collisions if rendered multiple times on the same page
- Fix comment: default pattern is @vapu.xyz, not @sharebot.net
- Replace per-user stats loop with a single aggregated JOIN query
- Show Wordmark (icon + text) in the expanded sidebar instead of the
  bare Sim icon; collapsed state keeps the small Sim icon unchanged
- Untrack scripts/ban-spam-accounts.ts (gitignored; one-off script)
- Credential selector: open OAuthRequiredModal inline instead of
  navigating to Settings → Integrations (matches MCP/tool-input pattern)
- Credential selector: update billing import from getSubscriptionAccessState
  to getSubscriptionStatus; drop writePendingCredentialCreateRequest and
  useSettingsNavigation dependencies
- settings-sidebar: use getSubscriptionAccessState instead of getSubscriptionStatus
  so billingBlocked and status validity are checked; add requiresMax gating so
  max-plan-only nav items (inbox) are hidden for lower-tier users
- credential-selector: same getSubscriptionAccessState migration for credential sets
  visibility check
- mothership chats PATCH: change else if to if for isUnread so both title and
  isUnread can be updated in a single request
- skills import: check Content-Length header before reading response body to avoid
  loading oversized files into memory
Checks file.size > 5 MB before calling extractSkillFromZip to prevent
zip bombs from exhausting browser memory at the client-side upload path.
Sim Mailer (requiresMax) and Email Polling (requiresTeam) now always
appear in the settings sidebar when billing is enabled and the
deployment is hosted. If the user lacks the required plan they see a
small MAX / TEAM badge next to the label and are taken to the page
which already contains the upgrade prompt.

Enterprise (Access Control, SSO) and Team management stay hard-hidden
for lower tiers. Admin/superuser items stay truly hidden.
…ements

- Move Enterprise plan card into the plan grid (auto-fit columns) instead
  of a separate standalone section below billing details
- Refactor billing details section: remove outer border/background,
  separate each row with top border + padding for cleaner separation
- Update button variants: Add Credits → active, Invoices → active
@waleedlatif1
Copy link
Collaborator Author

@greptile

@waleedlatif1
Copy link
Collaborator Author

@cursor review

…read are patched together

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…er+blur

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@waleedlatif1
Copy link
Collaborator Author

@greptile

@waleedlatif1
Copy link
Collaborator Author

@cursor review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

…tmatter

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@waleedlatif1
Copy link
Collaborator Author

@greptile

@waleedlatif1 waleedlatif1 merged commit 7583c8f into staging Mar 26, 2026
11 checks passed
@waleedlatif1 waleedlatif1 deleted the feat/misc-updates branch March 26, 2026 03:06
Sign up for free to 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