Skip to main content

Local Dependency Resolver

PastePrompt can add local dependency files from selected source files. This helps you include helper modules, local types, nearby package files, and supporting code without manually chasing every import.

The resolver is intentionally conservative. It is a context-building aid, not a compiler, package manager, or full language server.

What it does

When you click Add local imports, PastePrompt:

  1. Reads the currently selected files from the local repository.
  2. Looks for common local import patterns.
  3. Resolves matching files inside the selected repository root.
  4. Adds newly resolved files to the selected-files panel.
  5. Marks why each file was added, including the importer or import path.

Current support is focused on common local source references:

  • JavaScript and TypeScript relative imports, exports, require(), and dynamic imports.
  • Python relative imports.
  • Rust mod name; source module declarations.

Why it matters

Many useful review questions depend on code that is one or two files away from the selected target:

  • Shared type definitions.
  • Authorization helpers.
  • Serialization or validation utilities.
  • Local adapters.
  • Tests and fixtures that explain expected behavior.
  • Module glue code.

Adding this context manually is slow. Adding too much context wastes tokens. A local resolver gives you a focused starting point that you can still review and edit before export.

How to use it

  1. Select a repository.
  2. Search for the file or folder you want to review.
  3. Select the initial files.
  4. Click Add local imports.
  5. Review the selected-files panel.
  6. Remove files that are not useful for the question.
  7. Check the updated token budget.
  8. Generate the context bundle.

Example workflow

  1. Select src/auth/session.ts.
  2. Click Add local imports.
  3. PastePrompt adds:
    • src/auth/types.ts
    • src/auth/crypto.ts
    • src/shared/time.ts
  4. Review each added file in Preview.
  5. Apply a security-review prompt template.
  6. Copy or export the final bundle.

Example output in the selected-files panel

src/auth/session.ts Manual
src/auth/types.ts Imported by src/auth/session.ts
src/auth/crypto.ts Imported by src/auth/session.ts
src/shared/time.ts Via src/auth/session.ts -> src/auth/crypto.ts -> src/shared/time.ts

Limitations

  • Package imports such as react, lodash, or workspace aliases may not resolve automatically.
  • Custom TypeScript path aliases, generated modules, and build-time loaders may require manual selection.
  • The resolver does not compile code or validate runtime behavior.
  • It does not add ignored, binary, unreadable, or out-of-repository files by default.
  • Token budget can still grow quickly if selected files import broad utility trees.