6bf8bebf51
CI / Test and Build (push) Failing after 1s
CI / Migrate Dev DB (push) Has been skipped
CI / Migrate DB (push) Has been skipped
CodeQL / Analyze actions (push) Has been cancelled
CodeQL / Analyze javascript-typescript (push) Has been cancelled
CI / Detect Version (push) Has been cancelled
CI / Detect Desktop Changes (push) Has been cancelled
CI / Build AMD64 (blacksmith-2vcpu-ubuntu-2404, ./docker/cron.Dockerfile, ubuntu-latest, ghcr.io/simstudioai/cron) (push) Has been cancelled
CI / Build AMD64 (blacksmith-2vcpu-ubuntu-2404, ./docker/db.Dockerfile, ECR_MIGRATIONS, ubuntu-latest, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (blacksmith-4vcpu-ubuntu-2404, ./docker/pii.Dockerfile, ECR_PII, ubuntu-latest, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (blacksmith-4vcpu-ubuntu-2404, ./docker/realtime.Dockerfile, ECR_REALTIME, ubuntu-latest, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build AMD64 (blacksmith-8vcpu-ubuntu-2404, ./docker/app.Dockerfile, ECR_APP, linux-x64-8-core, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (blacksmith-4vcpu-ubuntu-2404-arm, ./docker/cron.Dockerfile, ubuntu-24.04-arm, ghcr.io/simstudioai/cron) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (blacksmith-4vcpu-ubuntu-2404-arm, ./docker/db.Dockerfile, ubuntu-24.04-arm, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (blacksmith-4vcpu-ubuntu-2404-arm, ./docker/pii.Dockerfile, ubuntu-24.04-arm, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (blacksmith-4vcpu-ubuntu-2404-arm, ./docker/realtime.Dockerfile, ubuntu-24.04-arm, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (blacksmith-8vcpu-ubuntu-2404-arm, ./docker/app.Dockerfile, linux-arm64-8-core, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
Publish CLI Package / publish-npm (push) Has been cancelled
Publish Python SDK / publish-pypi (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
Helm Chart / Lint, test, and validate chart (push) Has been cancelled
Helm Chart / Chart version bumped (push) Has been cancelled
Publish TypeScript SDK / publish-npm (push) Has been cancelled
CI / Build Dev ECR (blacksmith-8vcpu-ubuntu-2404, ./docker/app.Dockerfile, ECR_APP, linux-x64-8-core) (push) Has been cancelled
CI / Promote Images (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/cron) (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 / Build Dev ECR (blacksmith-2vcpu-ubuntu-2404, ./docker/db.Dockerfile, ECR_MIGRATIONS, ubuntu-latest) (push) Has been cancelled
CI / Build Dev ECR (blacksmith-4vcpu-ubuntu-2404, ./docker/pii.Dockerfile, ECR_PII, ubuntu-latest) (push) Has been cancelled
CI / Build Dev ECR (blacksmith-4vcpu-ubuntu-2404, ./docker/realtime.Dockerfile, ECR_REALTIME, ubuntu-latest) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Check Desktop Signing Secrets (push) Has been cancelled
CI / Desktop Release (push) Has been cancelled
CI / Create Desktop Prerelease (push) Has been cancelled
CI / Desktop Prerelease Build (push) Has been cancelled
CI / Publish Desktop Prerelease (push) Has been cancelled
CI / Prune Desktop Prereleases (push) Has been cancelled
Helm Chart / Install on kind and run helm test (push) Has been cancelled
123 lines
3.6 KiB
TypeScript
123 lines
3.6 KiB
TypeScript
import type {
|
|
TriggerDevListDeploymentsParams,
|
|
TriggerDevListDeploymentsResponse,
|
|
} from '@/tools/trigger_dev/types'
|
|
import {
|
|
buildTriggerDevHeaders,
|
|
mapTriggerDevDeployment,
|
|
TRIGGER_DEV_API_BASE,
|
|
TRIGGER_DEV_DEPLOYMENT_PROPERTIES,
|
|
} from '@/tools/trigger_dev/utils'
|
|
import type { ToolConfig } from '@/tools/types'
|
|
|
|
export const triggerDevListDeploymentsTool: ToolConfig<
|
|
TriggerDevListDeploymentsParams,
|
|
TriggerDevListDeploymentsResponse
|
|
> = {
|
|
id: 'trigger_dev_list_deployments',
|
|
name: 'Trigger.dev List Deployments',
|
|
description:
|
|
'List Trigger.dev deployments in the environment of the API key, with optional status and creation-time filters.',
|
|
version: '1.0.0',
|
|
|
|
params: {
|
|
apiKey: {
|
|
type: 'string',
|
|
required: true,
|
|
visibility: 'user-only',
|
|
description: 'Trigger.dev secret API key (starts with tr_)',
|
|
},
|
|
status: {
|
|
type: 'string',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description:
|
|
'Deployment status to filter by: PENDING, BUILDING, DEPLOYING, DEPLOYED, FAILED, CANCELED, or TIMED_OUT',
|
|
},
|
|
period: {
|
|
type: 'string',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'Only return deployments created in the given period (e.g., "1h", "7d")',
|
|
},
|
|
from: {
|
|
type: 'string',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'Only return deployments created on or after this ISO 8601 timestamp',
|
|
},
|
|
to: {
|
|
type: 'string',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'Only return deployments created on or before this ISO 8601 timestamp',
|
|
},
|
|
pageSize: {
|
|
type: 'number',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'Number of deployments per page (5 to 100, default 20)',
|
|
},
|
|
pageAfter: {
|
|
type: 'string',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'Cursor to start the page after, from the previous response pagination',
|
|
},
|
|
},
|
|
|
|
request: {
|
|
url: (params) => {
|
|
const query = new URLSearchParams()
|
|
if (params.pageSize) query.set('page[size]', String(params.pageSize))
|
|
if (params.pageAfter) query.set('page[after]', params.pageAfter)
|
|
if (params.status) query.set('status', params.status.toUpperCase())
|
|
if (params.period) query.set('period', params.period)
|
|
if (params.from) query.set('from', params.from)
|
|
if (params.to) query.set('to', params.to)
|
|
const queryString = query.toString()
|
|
return queryString
|
|
? `${TRIGGER_DEV_API_BASE}/api/v1/deployments?${queryString}`
|
|
: `${TRIGGER_DEV_API_BASE}/api/v1/deployments`
|
|
},
|
|
method: 'GET',
|
|
headers: (params) => buildTriggerDevHeaders(params.apiKey),
|
|
},
|
|
|
|
transformResponse: async (response) => {
|
|
const data = await response.json()
|
|
return {
|
|
success: true,
|
|
output: {
|
|
deployments: (data.data ?? []).map(mapTriggerDevDeployment),
|
|
pagination: {
|
|
next: data.pagination?.next ?? null,
|
|
},
|
|
},
|
|
}
|
|
},
|
|
|
|
outputs: {
|
|
deployments: {
|
|
type: 'array',
|
|
description: 'Deployments matching the filters',
|
|
items: {
|
|
type: 'object',
|
|
description: 'Deployment',
|
|
properties: TRIGGER_DEV_DEPLOYMENT_PROPERTIES,
|
|
},
|
|
},
|
|
pagination: {
|
|
type: 'object',
|
|
description: 'Cursor pagination details',
|
|
properties: {
|
|
next: {
|
|
type: 'string',
|
|
description: 'Cursor to pass as the page-after parameter for the next page',
|
|
nullable: true,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
}
|