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
+157
View File
@@ -0,0 +1,157 @@
import type { GetWorkflowRunParams, WorkflowRunResponse } from '@/tools/github/types'
import {
HEAD_COMMIT_OUTPUT,
PR_REFERENCE_OUTPUT,
REFERENCED_WORKFLOW_OUTPUT,
USER_OUTPUT,
WORKFLOW_RUN_OUTPUT_PROPERTIES,
} from '@/tools/github/types'
import type { ToolConfig } from '@/tools/types'
export const getWorkflowRunTool: ToolConfig<GetWorkflowRunParams, WorkflowRunResponse> = {
id: 'github_get_workflow_run',
name: 'GitHub Get Workflow Run',
description:
'Get detailed information about a specific workflow run by ID. Returns status, conclusion, timing, and links to the run.',
version: '1.0.0',
params: {
owner: {
type: 'string',
required: true,
visibility: 'user-or-llm',
description: 'Repository owner (user or organization)',
},
repo: {
type: 'string',
required: true,
visibility: 'user-or-llm',
description: 'Repository name',
},
run_id: {
type: 'number',
required: true,
visibility: 'user-or-llm',
description: 'Workflow run ID',
},
apiKey: {
type: 'string',
required: true,
visibility: 'user-only',
description: 'GitHub Personal Access Token',
},
},
request: {
url: (params) =>
`https://api.github.com/repos/${params.owner}/${params.repo}/actions/runs/${params.run_id}`,
method: 'GET',
headers: (params) => ({
Accept: 'application/vnd.github+json',
Authorization: `Bearer ${params.apiKey}`,
'X-GitHub-Api-Version': '2022-11-28',
}),
},
transformResponse: async (response) => {
const data = await response.json()
const content = `Workflow Run #${data.run_number}: ${data.name}
Status: ${data.status}${data.conclusion ? ` - ${data.conclusion}` : ''}
Branch: ${data.head_branch}
Commit: ${data.head_sha.substring(0, 7)}
Event: ${data.event}
Triggered by: ${data.triggering_actor?.login || 'Unknown'}
Started: ${data.run_started_at || data.created_at}
${data.updated_at ? `Updated: ${data.updated_at}` : ''}
${data.run_attempt ? `Attempt: ${data.run_attempt}` : ''}
URL: ${data.html_url}
Logs: ${data.logs_url}`
return {
success: true,
output: {
content,
metadata: {
id: data.id,
name: data.name,
status: data.status,
conclusion: data.conclusion,
html_url: data.html_url,
run_number: data.run_number,
},
},
}
},
outputs: {
content: { type: 'string', description: 'Human-readable workflow run details' },
metadata: {
type: 'object',
description: 'Workflow run metadata',
properties: {
id: { type: 'number', description: 'Workflow run ID' },
name: { type: 'string', description: 'Workflow name' },
status: { type: 'string', description: 'Run status' },
conclusion: { type: 'string', description: 'Run conclusion' },
html_url: { type: 'string', description: 'GitHub web URL' },
run_number: { type: 'number', description: 'Run number' },
},
},
},
}
export const getWorkflowRunV2Tool: ToolConfig<GetWorkflowRunParams, any> = {
id: 'github_get_workflow_run_v2',
name: getWorkflowRunTool.name,
description: getWorkflowRunTool.description,
version: '2.0.0',
params: getWorkflowRunTool.params,
request: getWorkflowRunTool.request,
transformResponse: async (response: Response) => {
const data = await response.json()
return {
success: true,
output: {
id: data.id,
name: data.name,
head_branch: data.head_branch,
head_sha: data.head_sha,
run_number: data.run_number,
run_attempt: data.run_attempt,
event: data.event,
status: data.status,
conclusion: data.conclusion ?? null,
workflow_id: data.workflow_id,
html_url: data.html_url,
logs_url: data.logs_url,
jobs_url: data.jobs_url,
artifacts_url: data.artifacts_url,
triggering_actor: data.triggering_actor,
pull_requests: data.pull_requests ?? [],
referenced_workflows: data.referenced_workflows ?? [],
head_commit: data.head_commit,
run_started_at: data.run_started_at,
created_at: data.created_at,
updated_at: data.updated_at,
},
}
},
outputs: {
...WORKFLOW_RUN_OUTPUT_PROPERTIES,
triggering_actor: USER_OUTPUT,
pull_requests: {
type: 'array',
description: 'Associated pull requests',
items: PR_REFERENCE_OUTPUT,
},
referenced_workflows: {
type: 'array',
description: 'Referenced workflows',
items: REFERENCED_WORKFLOW_OUTPUT,
},
head_commit: HEAD_COMMIT_OUTPUT,
},
}