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
191 lines
6.2 KiB
TypeScript
191 lines
6.2 KiB
TypeScript
import type { SentryUpdateIssueParams, SentryUpdateIssueResponse } from '@/tools/sentry/types'
|
|
import type { ToolConfig } from '@/tools/types'
|
|
|
|
export const updateIssueTool: ToolConfig<SentryUpdateIssueParams, SentryUpdateIssueResponse> = {
|
|
id: 'sentry_issues_update',
|
|
name: 'Update Issue',
|
|
description:
|
|
'Update a Sentry issue by changing its status, assignment, bookmark state, or other properties. Returns the updated issue details.',
|
|
version: '1.0.0',
|
|
|
|
params: {
|
|
apiKey: {
|
|
type: 'string',
|
|
required: true,
|
|
visibility: 'user-only',
|
|
description: 'Sentry API authentication token',
|
|
},
|
|
organizationSlug: {
|
|
type: 'string',
|
|
required: true,
|
|
visibility: 'user-or-llm',
|
|
description: 'The slug of the organization (e.g., "my-org")',
|
|
},
|
|
issueId: {
|
|
type: 'string',
|
|
required: true,
|
|
visibility: 'user-or-llm',
|
|
description: 'The unique ID of the issue to update (e.g., "12345")',
|
|
},
|
|
status: {
|
|
type: 'string',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description:
|
|
'New status for the issue: resolved, unresolved, ignored, or resolvedInNextRelease',
|
|
},
|
|
assignedTo: {
|
|
type: 'string',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description:
|
|
'Actor to assign the issue to, in the form "user:<id>" or "team:<id>" (a bare username or email is also accepted). Use an empty string to unassign.',
|
|
},
|
|
isBookmarked: {
|
|
type: 'boolean',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'Whether to bookmark the issue',
|
|
},
|
|
isSubscribed: {
|
|
type: 'boolean',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'Whether to subscribe to issue updates',
|
|
},
|
|
isPublic: {
|
|
type: 'boolean',
|
|
required: false,
|
|
visibility: 'user-only',
|
|
description: 'Whether the issue should be publicly visible',
|
|
},
|
|
},
|
|
|
|
request: {
|
|
url: (params) =>
|
|
`https://sentry.io/api/0/organizations/${params.organizationSlug}/issues/${params.issueId}/`,
|
|
method: 'PUT',
|
|
headers: (params) => ({
|
|
Authorization: `Bearer ${params.apiKey}`,
|
|
'Content-Type': 'application/json',
|
|
}),
|
|
body: (params) => {
|
|
const body: Record<string, any> = {}
|
|
|
|
if (params.status !== undefined && params.status !== null && params.status !== '') {
|
|
body.status = params.status
|
|
}
|
|
|
|
if (params.assignedTo !== undefined && params.assignedTo !== null) {
|
|
body.assignedTo = params.assignedTo === '' ? null : params.assignedTo
|
|
}
|
|
|
|
if (params.isBookmarked !== undefined && params.isBookmarked !== null) {
|
|
body.isBookmarked = params.isBookmarked
|
|
}
|
|
|
|
if (params.isSubscribed !== undefined && params.isSubscribed !== null) {
|
|
body.isSubscribed = params.isSubscribed
|
|
}
|
|
|
|
if (params.isPublic !== undefined && params.isPublic !== null) {
|
|
body.isPublic = params.isPublic
|
|
}
|
|
|
|
return body
|
|
},
|
|
},
|
|
|
|
transformResponse: async (response: Response) => {
|
|
const issue = await response.json()
|
|
|
|
return {
|
|
success: true,
|
|
output: {
|
|
issue: {
|
|
id: issue.id,
|
|
shortId: issue.shortId,
|
|
title: issue.title,
|
|
culprit: issue.culprit ?? null,
|
|
permalink: issue.permalink,
|
|
logger: issue.logger ?? null,
|
|
level: issue.level,
|
|
status: issue.status,
|
|
substatus: issue.substatus ?? null,
|
|
priority: issue.priority ?? null,
|
|
statusDetails: issue.statusDetails || {},
|
|
isPublic: issue.isPublic,
|
|
platform: issue.platform ?? null,
|
|
project: {
|
|
id: issue.project?.id || '',
|
|
name: issue.project?.name || '',
|
|
slug: issue.project?.slug || '',
|
|
platform: issue.project?.platform || '',
|
|
},
|
|
type: issue.type ?? null,
|
|
metadata: {
|
|
type: issue.metadata?.type || null,
|
|
value: issue.metadata?.value || null,
|
|
function: issue.metadata?.function || null,
|
|
},
|
|
numComments: issue.numComments || 0,
|
|
assignedTo: issue.assignedTo
|
|
? {
|
|
id: issue.assignedTo.id,
|
|
name: issue.assignedTo.name,
|
|
email: issue.assignedTo.email,
|
|
}
|
|
: null,
|
|
isBookmarked: issue.isBookmarked,
|
|
isSubscribed: issue.isSubscribed,
|
|
subscriptionDetails: issue.subscriptionDetails ?? null,
|
|
hasSeen: issue.hasSeen,
|
|
annotations: issue.annotations || [],
|
|
isUnhandled: issue.isUnhandled,
|
|
count: issue.count,
|
|
userCount: issue.userCount || 0,
|
|
firstSeen: issue.firstSeen,
|
|
lastSeen: issue.lastSeen,
|
|
stats: issue.stats || {},
|
|
},
|
|
},
|
|
}
|
|
},
|
|
|
|
outputs: {
|
|
issue: {
|
|
type: 'object',
|
|
description: 'The updated Sentry issue',
|
|
properties: {
|
|
id: { type: 'string', description: 'Unique issue ID' },
|
|
shortId: { type: 'string', description: 'Short issue identifier' },
|
|
title: { type: 'string', description: 'Issue title' },
|
|
status: { type: 'string', description: 'Updated issue status' },
|
|
substatus: {
|
|
type: 'string',
|
|
description: 'Issue substatus after the update',
|
|
optional: true,
|
|
},
|
|
priority: {
|
|
type: 'string',
|
|
description: 'Issue priority (high, medium, or low)',
|
|
optional: true,
|
|
},
|
|
assignedTo: {
|
|
type: 'object',
|
|
description: 'User assigned to the issue (if any)',
|
|
properties: {
|
|
id: { type: 'string', description: 'User ID' },
|
|
name: { type: 'string', description: 'User name' },
|
|
email: { type: 'string', description: 'User email' },
|
|
},
|
|
},
|
|
isBookmarked: { type: 'boolean', description: 'Whether the issue is bookmarked' },
|
|
isSubscribed: { type: 'boolean', description: 'Whether the user is subscribed to updates' },
|
|
isPublic: { type: 'boolean', description: 'Whether the issue is publicly visible' },
|
|
permalink: { type: 'string', description: 'Direct link to the issue in Sentry' },
|
|
},
|
|
},
|
|
},
|
|
}
|