Skip to content

npm resource#183

Merged
bmdavis419 merged 3 commits intomainfrom
davis/npm-resources
Feb 13, 2026
Merged

npm resource#183
bmdavis419 merged 3 commits intomainfrom
davis/npm-resources

Conversation

@bmdavis419
Copy link
Collaborator

@bmdavis419 bmdavis419 commented Feb 13, 2026

Greptile Overview

Greptile Summary

Added comprehensive npm package resource support to btca, allowing users to reference and query npm packages alongside git repositories and local directories.

Key Changes:

  • Implemented npm resource type with package fetching from npm registry, caching, and installation via bun add --ignore-scripts
  • Extended CLI commands (add and ask) to accept npm references in multiple formats
  • Added validation for npm package names (scoped and unscoped) and version/tag specifications
  • Enhanced error handling to extract hints from nested error chains
  • Updated collection service with npm metadata and citation rules
  • Deleted launch plan file 2.0-final-launch-commands.md (cleanup)

Supported npm reference formats:

  • Spec format: npm:react with optional version like npm:react@19.0.0
  • Scoped packages: npm:@types/node or npm:@types/node@22.10.1
  • npmjs.com URLs for packages and specific versions

Implementation Notes:

  • Uses Bun's spawn API for package installation with --ignore-scripts for security
  • Caches pinned versions to avoid refetching
  • Anonymous npm resources (inline mentions) get ephemeral cleanup
  • Follows existing patterns for git and local resources

Confidence Score: 4/5

  • This PR is safe to merge with low risk of breaking existing functionality
  • The implementation follows existing patterns for git and local resources, has comprehensive test coverage for the new npm functionality, and includes proper validation and error handling. The changes are additive rather than modifying existing behavior. Score is 4 rather than 5 due to: (1) the deleted plan file 2.0-final-launch-commands.md which should be noted, and (2) the new feature needs real-world testing to ensure npm package fetching works reliably across different package types.
  • Pay attention to 2.0-final-launch-commands.md (deleted plan file) - ensure this was intentional cleanup and not accidental deletion

Important Files Changed

Filename Overview
apps/server/src/resources/impls/npm.ts New npm resource implementation with package fetching, caching, and installation using bun add
apps/server/src/resources/service.ts Extended resource service to support npm resources alongside git and local resources
apps/server/src/validation/index.ts Added npm package validation and reference parsing with URL and spec format support
apps/cli/src/commands/add.ts Extended add command to support npm packages with URL and spec parsing
apps/server/src/collections/service.ts Added npm metadata support and citation rules for npm resources

Last reviewed commit: f47dcea

Copy link
Collaborator Author

bmdavis419 commented Feb 13, 2026

Copy link
Collaborator Author

bmdavis419 commented Feb 13, 2026

Merge activity

  • Feb 13, 5:09 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Feb 13, 5:12 AM UTC: Graphite rebased this pull request as part of a merge.
  • Feb 13, 5:13 AM UTC: @bmdavis419 merged this pull request with Graphite.

@bmdavis419 bmdavis419 changed the base branch from davis/onboarding-and-system-prompt to graphite-base/183 February 13, 2026 05:10
@bmdavis419 bmdavis419 changed the base branch from graphite-base/183 to main February 13, 2026 05:11
@bmdavis419 bmdavis419 merged commit d61fd05 into main Feb 13, 2026
3 of 5 checks passed
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