chore: import upstream snapshot with attribution
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

This commit is contained in:
wehub-resource-sync
2026-07-13 13:20:55 +08:00
commit d25d482dc2
13754 changed files with 4996608 additions and 0 deletions
+191
View File
@@ -0,0 +1,191 @@
import type { ListPRsParams, PRListResponse } from '@/tools/github/types'
import { BRANCH_REF_OUTPUT, PR_SUMMARY_OUTPUT_PROPERTIES, USER_OUTPUT } from '@/tools/github/types'
import type { ToolConfig } from '@/tools/types'
export const listPRsTool: ToolConfig<ListPRsParams, PRListResponse> = {
id: 'github_list_prs',
name: 'GitHub List Pull Requests',
description: 'List pull requests in a GitHub repository',
version: '1.0.0',
params: {
owner: {
type: 'string',
required: true,
visibility: 'user-or-llm',
description: 'Repository owner',
},
repo: {
type: 'string',
required: true,
visibility: 'user-or-llm',
description: 'Repository name',
},
state: {
type: 'string',
required: false,
visibility: 'user-or-llm',
description: 'Filter by state: open, closed, or all',
default: 'open',
},
head: {
type: 'string',
required: false,
visibility: 'user-or-llm',
description:
'Filter by head user or branch name (format: user:ref-name or organization:ref-name)',
},
base: {
type: 'string',
required: false,
visibility: 'user-or-llm',
description: 'Filter by base branch name',
},
sort: {
type: 'string',
required: false,
visibility: 'user-or-llm',
description: 'Sort by: created, updated, popularity, or long-running',
default: 'created',
},
direction: {
type: 'string',
required: false,
visibility: 'user-or-llm',
description: 'Sort direction: asc or desc',
default: 'desc',
},
per_page: {
type: 'number',
required: false,
visibility: 'user-or-llm',
description: 'Results per page (max 100)',
default: 30,
},
page: {
type: 'number',
required: false,
visibility: 'user-or-llm',
description: 'Page number',
default: 1,
},
apiKey: {
type: 'string',
required: true,
visibility: 'user-only',
description: 'GitHub API token',
},
},
request: {
url: (params) => {
const url = new URL(`https://api.github.com/repos/${params.owner}/${params.repo}/pulls`)
if (params.state) url.searchParams.append('state', params.state)
if (params.head) url.searchParams.append('head', params.head)
if (params.base) url.searchParams.append('base', params.base)
if (params.sort) url.searchParams.append('sort', params.sort)
if (params.direction) url.searchParams.append('direction', params.direction)
if (params.per_page) url.searchParams.append('per_page', Number(params.per_page).toString())
if (params.page) url.searchParams.append('page', Number(params.page).toString())
return url.toString()
},
method: 'GET',
headers: (params) => ({
Accept: 'application/vnd.github.v3+json',
Authorization: `Bearer ${params.apiKey}`,
'X-GitHub-Api-Version': '2022-11-28',
}),
},
transformResponse: async (response) => {
const prs = await response.json()
const openCount = prs.filter((pr: any) => pr.state === 'open').length
const closedCount = prs.filter((pr: any) => pr.state === 'closed').length
const content = `Found ${prs.length} pull request(s)
Open: ${openCount}, Closed: ${closedCount}
${prs
.map(
(pr: any) =>
`#${pr.number}: ${pr.title} (${pr.state})
URL: ${pr.html_url}`
)
.join('\n\n')}`
return {
success: true,
output: {
content,
metadata: {
prs: prs.map((pr: any) => ({
number: pr.number,
title: pr.title,
state: pr.state,
html_url: pr.html_url,
created_at: pr.created_at,
updated_at: pr.updated_at,
})),
total_count: prs.length,
open_count: openCount,
closed_count: closedCount,
},
},
}
},
outputs: {
content: { type: 'string', description: 'Human-readable list of pull requests' },
metadata: {
type: 'object',
description: 'Pull requests list metadata',
properties: {
prs: {
type: 'array',
description: 'Array of pull request summaries',
},
total_count: { type: 'number', description: 'Total number of PRs returned' },
open_count: { type: 'number', description: 'Number of open PRs' },
closed_count: { type: 'number', description: 'Number of closed PRs' },
},
},
},
}
export const listPRsV2Tool: ToolConfig<ListPRsParams, any> = {
id: 'github_list_prs_v2',
name: listPRsTool.name,
description: listPRsTool.description,
version: '2.0.0',
params: listPRsTool.params,
request: listPRsTool.request,
transformResponse: async (response: Response) => {
const prs = await response.json()
return {
success: true,
output: {
items: prs ?? [],
count: prs?.length ?? 0,
},
}
},
outputs: {
items: {
type: 'array',
description: 'Array of pull request objects',
items: {
type: 'object',
properties: {
...PR_SUMMARY_OUTPUT_PROPERTIES,
user: USER_OUTPUT,
head: BRANCH_REF_OUTPUT,
base: BRANCH_REF_OUTPUT,
},
},
},
count: { type: 'number', description: 'Number of PRs returned' },
},
}