d25d482dc2
Publish CLI Package / publish-npm (push) Waiting to run
Publish Python SDK / publish-pypi (push) Waiting to run
Publish TypeScript SDK / publish-npm (push) Waiting to run
CI / Migrate Dev DB (push) Has been skipped
CI / Detect Version (push) Has been cancelled
CI / Migrate DB (push) Has been cancelled
CI / Build Dev ECR (./docker/app.Dockerfile, ECR_APP) (push) Has been cancelled
CI / Build Dev ECR (./docker/db.Dockerfile, ECR_MIGRATIONS) (push) Has been cancelled
CI / Build Dev ECR (./docker/pii.Dockerfile, ECR_PII) (push) Has been cancelled
CI / Build Dev ECR (./docker/realtime.Dockerfile, ECR_REALTIME) (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
CI / Build AMD64 (./docker/app.Dockerfile, ECR_APP, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build AMD64 (./docker/db.Dockerfile, ECR_MIGRATIONS, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (./docker/pii.Dockerfile, ECR_PII, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (./docker/realtime.Dockerfile, ECR_REALTIME, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/app.Dockerfile, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/db.Dockerfile, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/pii.Dockerfile, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/realtime.Dockerfile, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Test and Build (push) Has been cancelled
116 lines
3.2 KiB
TypeScript
116 lines
3.2 KiB
TypeScript
import type { GreptileStatusParams, GreptileStatusResponse } from '@/tools/greptile/types'
|
|
import type { ToolConfig } from '@/tools/types'
|
|
|
|
export const statusTool: ToolConfig<GreptileStatusParams, GreptileStatusResponse> = {
|
|
id: 'greptile_status',
|
|
name: 'Greptile Repository Status',
|
|
description:
|
|
'Check the indexing status of a repository. Use this to verify if a repository is ready to be queried or to monitor indexing progress.',
|
|
version: '1.0.0',
|
|
|
|
params: {
|
|
remote: {
|
|
type: 'string',
|
|
required: true,
|
|
visibility: 'user-only',
|
|
description: 'Git remote type: github or gitlab',
|
|
},
|
|
repository: {
|
|
type: 'string',
|
|
required: true,
|
|
visibility: 'user-or-llm',
|
|
description: 'Repository in owner/repo format. Example: "facebook/react" or "vercel/next.js"',
|
|
},
|
|
branch: {
|
|
type: 'string',
|
|
required: true,
|
|
visibility: 'user-only',
|
|
description: 'Branch name (e.g., "main" or "master")',
|
|
},
|
|
apiKey: {
|
|
type: 'string',
|
|
required: true,
|
|
visibility: 'user-only',
|
|
description: 'Greptile API key',
|
|
},
|
|
githubToken: {
|
|
type: 'string',
|
|
required: true,
|
|
visibility: 'user-only',
|
|
description: 'GitHub Personal Access Token with repo read access',
|
|
},
|
|
},
|
|
|
|
request: {
|
|
url: (params) => {
|
|
// Repository ID format: remote:branch:owner/repo (URL encoded)
|
|
const repositoryId = `${params.remote}:${params.branch}:${params.repository}`
|
|
return `https://api.greptile.com/v2/repositories/${encodeURIComponent(repositoryId)}`
|
|
},
|
|
method: 'GET',
|
|
headers: (params) => ({
|
|
'Content-Type': 'application/json',
|
|
Authorization: `Bearer ${params.apiKey}`,
|
|
'X-Github-Token': params.githubToken,
|
|
}),
|
|
},
|
|
|
|
transformResponse: async (response: Response) => {
|
|
const data = await response.json()
|
|
|
|
return {
|
|
success: true,
|
|
output: {
|
|
repository: data.repository || '',
|
|
remote: data.remote || '',
|
|
branch: data.branch || '',
|
|
private: data.private || false,
|
|
status: data.status || 'unknown',
|
|
filesProcessed: data.filesProcessed,
|
|
numFiles: data.numFiles,
|
|
sampleQuestions: data.sampleQuestions || [],
|
|
sha: data.sha,
|
|
},
|
|
}
|
|
},
|
|
|
|
outputs: {
|
|
repository: {
|
|
type: 'string',
|
|
description: 'Repository name (owner/repo)',
|
|
},
|
|
remote: {
|
|
type: 'string',
|
|
description: 'Git remote (github/gitlab)',
|
|
},
|
|
branch: {
|
|
type: 'string',
|
|
description: 'Branch name',
|
|
},
|
|
private: {
|
|
type: 'boolean',
|
|
description: 'Whether the repository is private',
|
|
},
|
|
status: {
|
|
type: 'string',
|
|
description: 'Indexing status: submitted, cloning, processing, completed, or failed',
|
|
},
|
|
filesProcessed: {
|
|
type: 'number',
|
|
description: 'Number of files processed so far',
|
|
},
|
|
numFiles: {
|
|
type: 'number',
|
|
description: 'Total number of files in the repository',
|
|
},
|
|
sampleQuestions: {
|
|
type: 'array',
|
|
description: 'Sample questions for the indexed repository',
|
|
},
|
|
sha: {
|
|
type: 'string',
|
|
description: 'Git commit SHA of the indexed version',
|
|
},
|
|
},
|
|
}
|