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
151 lines
4.6 KiB
TypeScript
151 lines
4.6 KiB
TypeScript
import {
|
|
FIELD_OUTPUT_PROPERTIES,
|
|
mapField,
|
|
mapPagination,
|
|
PAGINATION_OUTPUT_PROPERTIES,
|
|
ROCKETLANE_API_BASE,
|
|
type RocketlaneFieldListResponse,
|
|
type RocketlaneListFieldsParams,
|
|
rocketlaneError,
|
|
rocketlaneHeaders,
|
|
} from '@/tools/rocketlane/types'
|
|
import type { ToolConfig } from '@/tools/types'
|
|
|
|
export const rocketlaneListFieldsTool: ToolConfig<
|
|
RocketlaneListFieldsParams,
|
|
RocketlaneFieldListResponse
|
|
> = {
|
|
id: 'rocketlane_list_fields',
|
|
name: 'Rocketlane List Fields',
|
|
description:
|
|
'List fields in your Rocketlane account, with optional filters, sorting, and pagination',
|
|
version: '1.0.0',
|
|
|
|
params: {
|
|
apiKey: {
|
|
type: 'string',
|
|
required: true,
|
|
visibility: 'user-only',
|
|
description: 'Rocketlane API key',
|
|
},
|
|
pageSize: {
|
|
type: 'number',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'Number of fields per page',
|
|
},
|
|
pageToken: {
|
|
type: 'string',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'Page token returned by a previous request (valid for 15 minutes)',
|
|
},
|
|
includeFields: {
|
|
type: 'string',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description:
|
|
'Comma-separated extra field properties to include in the response (supported: options)',
|
|
},
|
|
includeAllFields: {
|
|
type: 'boolean',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'Whether to return all field properties in the response',
|
|
},
|
|
sortBy: {
|
|
type: 'string',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'Property to sort by (supported: fieldLabel)',
|
|
},
|
|
sortOrder: {
|
|
type: 'string',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'Sort order (ASC or DESC)',
|
|
},
|
|
match: {
|
|
type: 'string',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'Whether results must match all filters or any filter (all or any)',
|
|
},
|
|
objectType: {
|
|
type: 'string',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'Filter by associated object type (PROJECT, TASK, or USER)',
|
|
},
|
|
fieldType: {
|
|
type: 'string',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description:
|
|
'Filter by field type (TEXT, MULTI_LINE_TEXT, YES_OR_NO, DATE, SINGLE_CHOICE, MULTIPLE_CHOICE, SINGLE_USER, MULTIPLE_USER, NUMBER, NOTE, RATING)',
|
|
},
|
|
enabled: {
|
|
type: 'boolean',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'Filter by enabled state',
|
|
},
|
|
private: {
|
|
type: 'boolean',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'Filter by privacy setting',
|
|
},
|
|
},
|
|
|
|
request: {
|
|
url: (params) => {
|
|
const url = new URL(`${ROCKETLANE_API_BASE}/fields`)
|
|
if (params.pageSize != null) url.searchParams.set('pageSize', String(params.pageSize))
|
|
if (params.pageToken) url.searchParams.set('pageToken', params.pageToken)
|
|
if (params.includeFields) url.searchParams.set('includeFields', params.includeFields)
|
|
if (params.includeAllFields != null) {
|
|
url.searchParams.set('includeAllFields', String(params.includeAllFields))
|
|
}
|
|
if (params.sortBy) url.searchParams.set('sortBy', params.sortBy)
|
|
if (params.sortOrder) url.searchParams.set('sortOrder', params.sortOrder)
|
|
if (params.match) url.searchParams.set('match', params.match)
|
|
if (params.objectType) url.searchParams.set('objectType.eq', params.objectType)
|
|
if (params.fieldType) url.searchParams.set('fieldType.eq', params.fieldType)
|
|
if (params.enabled != null) url.searchParams.set('enabled.eq', String(params.enabled))
|
|
if (params.private != null) url.searchParams.set('private.eq', String(params.private))
|
|
return url.toString()
|
|
},
|
|
method: 'GET',
|
|
headers: (params) => rocketlaneHeaders(params.apiKey),
|
|
},
|
|
|
|
transformResponse: async (response: Response) => {
|
|
if (!response.ok) {
|
|
throw new Error(await rocketlaneError(response))
|
|
}
|
|
const data = await response.json()
|
|
const fields = Array.isArray(data?.data) ? data.data : []
|
|
return {
|
|
success: true,
|
|
output: {
|
|
fields: fields.map(mapField),
|
|
pagination: mapPagination(data?.pagination),
|
|
},
|
|
}
|
|
},
|
|
|
|
outputs: {
|
|
fields: {
|
|
type: 'array',
|
|
description: 'List of fields',
|
|
items: { type: 'object', properties: FIELD_OUTPUT_PROPERTIES },
|
|
},
|
|
pagination: {
|
|
type: 'object',
|
|
description: 'Pagination details for the result set',
|
|
properties: PAGINATION_OUTPUT_PROPERTIES,
|
|
},
|
|
},
|
|
}
|