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
146 lines
4.6 KiB
TypeScript
146 lines
4.6 KiB
TypeScript
import type {
|
|
RootlyUpdateActionItemParams,
|
|
RootlyUpdateActionItemResponse,
|
|
} from '@/tools/rootly/types'
|
|
import type { ToolConfig } from '@/tools/types'
|
|
|
|
export const rootlyUpdateActionItemTool: ToolConfig<
|
|
RootlyUpdateActionItemParams,
|
|
RootlyUpdateActionItemResponse
|
|
> = {
|
|
id: 'rootly_update_action_item',
|
|
name: 'Rootly Update Action Item',
|
|
description: 'Update a Rootly incident action item (status, priority, assignee, etc.).',
|
|
version: '1.0.0',
|
|
|
|
params: {
|
|
apiKey: {
|
|
type: 'string',
|
|
required: true,
|
|
visibility: 'user-only',
|
|
description: 'Rootly API key',
|
|
},
|
|
actionItemId: {
|
|
type: 'string',
|
|
required: true,
|
|
visibility: 'user-or-llm',
|
|
description: 'The ID of the action item to update',
|
|
},
|
|
summary: {
|
|
type: 'string',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'Updated action item title',
|
|
},
|
|
description: {
|
|
type: 'string',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'Updated description',
|
|
},
|
|
kind: {
|
|
type: 'string',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'The kind of action item (task, follow_up)',
|
|
},
|
|
priority: {
|
|
type: 'string',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'Priority level (high, medium, low)',
|
|
},
|
|
status: {
|
|
type: 'string',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'Action item status (open, in_progress, cancelled, done)',
|
|
},
|
|
assignedToUserId: {
|
|
type: 'string',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'The user ID to assign the action item to',
|
|
},
|
|
dueDate: {
|
|
type: 'string',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'Due date for the action item',
|
|
},
|
|
},
|
|
|
|
request: {
|
|
url: (params) => `https://api.rootly.com/v1/action_items/${params.actionItemId.trim()}`,
|
|
method: 'PUT',
|
|
headers: (params) => ({
|
|
'Content-Type': 'application/vnd.api+json',
|
|
Authorization: `Bearer ${params.apiKey}`,
|
|
}),
|
|
body: (params) => {
|
|
const attributes: Record<string, unknown> = {}
|
|
if (params.summary) attributes.summary = params.summary
|
|
if (params.description) attributes.description = params.description
|
|
if (params.kind) attributes.kind = params.kind
|
|
if (params.priority) attributes.priority = params.priority
|
|
if (params.status) attributes.status = params.status
|
|
if (params.assignedToUserId) {
|
|
const numericId = Number.parseInt(params.assignedToUserId, 10)
|
|
if (!Number.isNaN(numericId)) attributes.assigned_to_user_id = numericId
|
|
}
|
|
if (params.dueDate) attributes.due_date = params.dueDate
|
|
return {
|
|
data: { type: 'incident_action_items', id: params.actionItemId.trim(), attributes },
|
|
}
|
|
},
|
|
},
|
|
|
|
transformResponse: async (response: Response) => {
|
|
if (!response.ok) {
|
|
const errorData = await response.json().catch(() => ({}))
|
|
return {
|
|
success: false,
|
|
output: { actionItem: {} as RootlyUpdateActionItemResponse['output']['actionItem'] },
|
|
error: errorData.errors?.[0]?.detail || `HTTP ${response.status}: ${response.statusText}`,
|
|
}
|
|
}
|
|
|
|
const data = await response.json()
|
|
const attrs = data.data?.attributes || {}
|
|
return {
|
|
success: true,
|
|
output: {
|
|
actionItem: {
|
|
id: data.data?.id ?? null,
|
|
summary: attrs.summary ?? '',
|
|
description: attrs.description ?? null,
|
|
kind: attrs.kind ?? null,
|
|
priority: attrs.priority ?? null,
|
|
status: attrs.status ?? null,
|
|
dueDate: attrs.due_date ?? null,
|
|
createdAt: attrs.created_at ?? '',
|
|
updatedAt: attrs.updated_at ?? '',
|
|
},
|
|
},
|
|
}
|
|
},
|
|
|
|
outputs: {
|
|
actionItem: {
|
|
type: 'object',
|
|
description: 'The updated action item',
|
|
properties: {
|
|
id: { type: 'string', description: 'Unique action item ID' },
|
|
summary: { type: 'string', description: 'Action item title' },
|
|
description: { type: 'string', description: 'Action item description' },
|
|
kind: { type: 'string', description: 'Action item kind (task, follow_up)' },
|
|
priority: { type: 'string', description: 'Priority level' },
|
|
status: { type: 'string', description: 'Action item status' },
|
|
dueDate: { type: 'string', description: 'Due date' },
|
|
createdAt: { type: 'string', description: 'Creation date' },
|
|
updatedAt: { type: 'string', description: 'Last update date' },
|
|
},
|
|
},
|
|
},
|
|
}
|