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
+174
View File
@@ -0,0 +1,174 @@
import type { DeleteFileParams, DeleteFileResponse } from '@/tools/github/types'
import type { ToolConfig } from '@/tools/types'
export const deleteFileTool: ToolConfig<DeleteFileParams, DeleteFileResponse> = {
id: 'github_delete_file',
name: 'GitHub Delete File',
description:
'Delete a file from a GitHub repository. Requires the file SHA. This operation cannot be undone through the API.',
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',
},
path: {
type: 'string',
required: true,
visibility: 'user-or-llm',
description: 'Path to the file to delete (e.g., "src/oldfile.ts")',
},
message: {
type: 'string',
required: true,
visibility: 'user-or-llm',
description: 'Commit message for this file deletion',
},
sha: {
type: 'string',
required: true,
visibility: 'user-or-llm',
description: 'The blob SHA of the file being deleted (get from github_get_file_content)',
},
branch: {
type: 'string',
required: false,
visibility: 'user-or-llm',
description: 'Branch to delete the file from (defaults to repository default branch)',
},
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}/contents/${params.path}`,
method: 'DELETE',
headers: (params) => ({
Accept: 'application/vnd.github+json',
Authorization: `Bearer ${params.apiKey}`,
'X-GitHub-Api-Version': '2022-11-28',
}),
body: (params) => {
const body: Record<string, any> = {
message: params.message,
sha: params.sha, // Required for delete
}
if (params.branch) {
body.branch = params.branch
}
return body
},
},
transformResponse: async (response, params) => {
const data = await response.json()
const content = `File deleted successfully!
Path: ${data.commit.sha ? 'File removed from repository' : 'Unknown'}
Deleted: Yes
Commit:
- SHA: ${data.commit.sha}
- Message: ${data.commit.message || 'N/A'}
- Author: ${data.commit.author?.name || 'N/A'}
- Date: ${data.commit.author?.date || 'N/A'}
View commit: ${data.commit.html_url || 'N/A'}`
return {
success: true,
output: {
content,
metadata: {
deleted: true,
path: params?.path ?? '',
commit: {
sha: data.commit.sha,
message: data.commit.message || '',
author: {
name: data.commit.author?.name || '',
email: data.commit.author?.email || '',
date: data.commit.author?.date || '',
},
committer: {
name: data.commit.committer?.name || '',
email: data.commit.committer?.email || '',
date: data.commit.committer?.date || '',
},
html_url: data.commit.html_url || '',
},
},
},
}
},
outputs: {
content: { type: 'string', description: 'Human-readable file deletion confirmation' },
metadata: {
type: 'object',
description: 'Deletion confirmation and commit metadata',
properties: {
deleted: { type: 'boolean', description: 'Whether the file was deleted' },
path: { type: 'string', description: 'File path that was deleted' },
commit: {
type: 'object',
description: 'Commit information',
properties: {
sha: { type: 'string', description: 'Commit SHA' },
message: { type: 'string', description: 'Commit message' },
author: {
type: 'object',
description: 'Author information',
},
committer: {
type: 'object',
description: 'Committer information',
},
html_url: { type: 'string', description: 'Commit URL' },
},
},
},
},
},
}
export const deleteFileV2Tool: ToolConfig<DeleteFileParams, any> = {
id: 'github_delete_file_v2',
name: deleteFileTool.name,
description: deleteFileTool.description,
version: '2.0.0',
params: deleteFileTool.params,
request: deleteFileTool.request,
transformResponse: async (response: Response) => {
const data = await response.json()
return {
success: true,
output: {
content: data.content ?? null, // null when file is deleted
commit: data.commit,
},
}
},
outputs: {
content: { type: 'json', description: 'File content info (null for delete)', optional: true },
commit: { type: 'json', description: 'Commit information' },
},
}