Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Greptile Overview
Greptile Summary
This PR adds npm package support as a new resource type alongside the existing git resources, and removes the
syncMCP tool and its associated infrastructure (stripJsonComments,updateResourceInternal,updateProjectModelInternal,btca.remote.schema.json).react,@types/node) as documentation resources through the web UI, MCP API, and internal mutations. The schema, validators, config generation, sandbox status detection, and UI have all been updated to handle thenpmtype discriminated union alongsidegit.syncMCP tool and related internal mutations have been removed. Documentation (mcp.mdx,btca.spec.md) has been updated accordingly andbtca.remote.schema.jsonhas been deleted.cachedResources.typeare optional, anduserResourcesfields (url,branch,package,version) are optional to support existing data without a migration.isValidNpmPackage,NPM_PACKAGE_SEGMENT_REGEX, etc.) is duplicated acrossmcp.ts,mcpInternal.ts,resources.ts, and the Svelte settings page. Consider extracting into a shared module.Confidence Score: 4/5
updatePackagesis called. No existing features appear broken by these changes.apps/web/src/convex/instances/actions.tshas inconsistentupdatePackagesgating.apps/web/src/convex/mcpInternal.tsandapps/web/src/convex/resources.tscontain heavily duplicated validation logic.Important Files Changed
cachedResourcesanduserResourcestables extended with optionaltype,package,versionfields.userResources.typeis required (union),cachedResources.typeis optional for backward compat.syncaction andstripJsonComments, added npm resource support toaddResourceandlistResourceswith proper type-specific validation. Contains duplicated npm validation logic.updateResourceInternalandupdateProjectModelInternal(sync feature removal). AddedresolveMcpResourceInputand npm validation logic.addResourceInternalnow supports npm type resources.mapUserResource,mapGlobalResource, split validators into git/npm variants, addedresolveAddCustomResourceInputwith full validation. Contains duplicated npm validation logic.generateBtcaConfig,getResourceConfigs,getSandboxStatusto handle both types. Added conditionalupdatePackagesin provision/wake paths.syncResourcesmissingupdatePackagesfor npm resources.addResourceschema now supports npm fields, removedsynctool entirely. Resource type is inferred when not explicitly provided for backward compatibility.isNpmCachedResourceandgetCachedResourceDetailhelpers. Shows git/npm badge per resource.Last reviewed commit: 5456f0b
Context used:
dashboard- AGENTS.md (source)