Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • added greptile tools/block
  • updated copilot panel styling

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 Dec 28, 2025

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

Project Deployment Review Updated (UTC)
docs Ready Ready Preview, Comment Dec 28, 2025 8:10pm

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 28, 2025

Greptile Summary

This PR adds a complete Greptile integration to enable AI-powered codebase search and Q&A capabilities within Sim workflows. The implementation includes four tools (query, search, index repository, and status checking), a unified block interface, comprehensive documentation, and minor copilot panel styling improvements.

Key Changes:

  • Implemented four Greptile API tools with proper credential handling using user-only visibility
  • Created a unified block with conditional UI that switches between operations
  • Added TypeScript types and utilities for repository parsing
  • Documented all tools with input/output specifications
  • Disabled the search tool in the block UI due to Greptile API v1 deprecation (though the tool implementation remains)
  • Improved copilot markdown rendering with better spacing for paragraphs, lists, and headings
  • Removed unnecessary inline comments from markdown renderer

Technical Highlights:

  • Proper URL encoding for repository IDs in status endpoint
  • Clean separation of concerns with dedicated files for each tool
  • Repository string parsing supports both short format (owner/repo) and full format (github:main:owner/repo)
  • API key and GitHub token correctly use user-only visibility per project guidelines

Confidence Score: 5/5

  • This PR is safe to merge with no critical issues found
  • The implementation is clean, well-structured, and follows project conventions. Credentials are properly configured with user-only visibility as required. All tools have comprehensive type definitions, the code is modular and maintainable, and documentation is thorough. The styling changes are minor and non-breaking.
  • No files require special attention

Important Files Changed

Filename Overview
apps/sim/tools/greptile/query.ts Implemented Greptile query tool with proper parameter configuration and API integration
apps/sim/tools/greptile/search.ts Implemented Greptile search tool for code reference retrieval
apps/sim/tools/greptile/index_repo.ts Implemented repository indexing tool with status endpoint extraction
apps/sim/tools/greptile/status.ts Implemented repository status checker with proper URL encoding
apps/sim/tools/greptile/types.ts Well-structured TypeScript types for all Greptile operations
apps/sim/blocks/blocks/greptile.ts Comprehensive block configuration with conditional UI fields for different operations

Sequence Diagram

sequenceDiagram
    participant User
    participant SimWorkflow
    participant GreptileBlock
    participant GreptileTool
    participant GreptileAPI
    participant GitHub

    Note over User,GitHub: Repository Indexing Flow
    User->>SimWorkflow: Configure Greptile block
    User->>GreptileBlock: Select "Index Repository" operation
    User->>GreptileBlock: Provide repo details & credentials
    GreptileBlock->>GreptileTool: Call greptile_index_repo
    GreptileTool->>GreptileAPI: POST /v2/repositories
    GreptileAPI->>GitHub: Fetch repository (using GitHub token)
    GitHub-->>GreptileAPI: Repository data
    GreptileAPI-->>GreptileTool: {statusEndpoint, repositoryId}
    GreptileTool-->>GreptileBlock: Return indexing status
    GreptileBlock-->>User: Display status endpoint

    Note over User,GitHub: Status Check Flow
    User->>GreptileBlock: Select "Check Status" operation
    GreptileBlock->>GreptileTool: Call greptile_status
    GreptileTool->>GreptileAPI: GET /v2/repositories/{id}
    GreptileAPI-->>GreptileTool: {status, filesProcessed, numFiles}
    GreptileTool-->>User: Display indexing progress

    Note over User,GitHub: Query Flow
    User->>GreptileBlock: Select "Query" operation
    User->>GreptileBlock: Enter natural language query
    GreptileBlock->>GreptileTool: Call greptile_query
    GreptileTool->>GreptileAPI: POST /v2/query with repositories
    GreptileAPI->>GreptileAPI: AI analysis of indexed code
    GreptileAPI-->>GreptileTool: {message, sources[]}
    GreptileTool-->>User: AI answer + code references
Loading

@waleedlatif1 waleedlatif1 merged commit 7761b16 into staging Dec 28, 2025
11 checks passed
@waleedlatif1 waleedlatif1 deleted the feat/tools branch December 28, 2025 20:13
@waleedlatif1 waleedlatif1 mentioned this pull request Dec 28, 2025
10 tasks
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.

2 participants