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
102 lines
3.0 KiB
TypeScript
102 lines
3.0 KiB
TypeScript
import type { GetBuildLogParams, GetBuildLogResponse } from '@/tools/azure_devops/types'
|
|
import type { ToolConfig } from '@/tools/types'
|
|
|
|
export const getBuildLogTool: ToolConfig<GetBuildLogParams, GetBuildLogResponse> = {
|
|
id: 'azure_devops_get_build_log',
|
|
name: 'Azure DevOps Get Build Log',
|
|
description:
|
|
'Fetch the text content of a specific build log in Azure DevOps. Use List Build Logs first to get the log ID. Optionally retrieve only a line range with startLine/endLine.',
|
|
version: '1.0.0',
|
|
|
|
params: {
|
|
organization: {
|
|
type: 'string',
|
|
required: true,
|
|
visibility: 'user-or-llm',
|
|
description: 'Azure DevOps organization name',
|
|
},
|
|
project: {
|
|
type: 'string',
|
|
required: true,
|
|
visibility: 'user-or-llm',
|
|
description: 'Azure DevOps project name',
|
|
},
|
|
buildId: {
|
|
type: 'number',
|
|
required: true,
|
|
visibility: 'user-or-llm',
|
|
description: 'The build ID containing the log',
|
|
},
|
|
logId: {
|
|
type: 'number',
|
|
required: true,
|
|
visibility: 'user-or-llm',
|
|
description: 'The log entry ID to fetch (from List Build Logs)',
|
|
},
|
|
startLine: {
|
|
type: 'number',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'First line to return (1-based, inclusive)',
|
|
},
|
|
endLine: {
|
|
type: 'number',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'Last line to return (1-based, inclusive)',
|
|
},
|
|
accessToken: {
|
|
type: 'string',
|
|
required: true,
|
|
visibility: 'user-only',
|
|
description: 'Azure DevOps Personal Access Token (scopes: Build: Read)',
|
|
},
|
|
},
|
|
|
|
request: {
|
|
url: (params) => {
|
|
const url = new URL(
|
|
`https://dev.azure.com/${params.organization.trim()}/${params.project.trim()}/_apis/build/builds/${params.buildId}/logs/${params.logId}`
|
|
)
|
|
url.searchParams.set('api-version', '7.2-preview.2')
|
|
if (params.startLine !== undefined)
|
|
url.searchParams.set('startLine', Number(params.startLine).toString())
|
|
if (params.endLine !== undefined)
|
|
url.searchParams.set('endLine', Number(params.endLine).toString())
|
|
return url.toString()
|
|
},
|
|
method: 'GET',
|
|
headers: (params) => ({
|
|
Accept: 'text/plain',
|
|
Authorization: `Basic ${btoa(`:${params.accessToken}`)}`,
|
|
}),
|
|
},
|
|
|
|
transformResponse: async (response) => {
|
|
const text = await response.text()
|
|
const trimmed = text.trim()
|
|
const lineCount = trimmed.length === 0 ? 0 : trimmed.split('\n').length
|
|
|
|
return {
|
|
success: true,
|
|
output: {
|
|
content: trimmed.length === 0 ? 'Log is empty.' : text,
|
|
metadata: {
|
|
lineCount,
|
|
},
|
|
},
|
|
}
|
|
},
|
|
|
|
outputs: {
|
|
content: { type: 'string', description: 'Raw log text' },
|
|
metadata: {
|
|
type: 'object',
|
|
description: 'Log metadata',
|
|
properties: {
|
|
lineCount: { type: 'number', description: 'Number of lines in the returned log text' },
|
|
},
|
|
},
|
|
},
|
|
}
|