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
112 lines
2.9 KiB
TypeScript
112 lines
2.9 KiB
TypeScript
import type { ToolConfig } from '@/tools/types'
|
|
|
|
export const s3ListBucketsTool: ToolConfig = {
|
|
id: 's3_list_buckets',
|
|
name: 'S3 List Buckets',
|
|
description: 'List the S3 buckets owned by the authenticated AWS account',
|
|
version: '1.0.0',
|
|
|
|
params: {
|
|
accessKeyId: {
|
|
type: 'string',
|
|
required: true,
|
|
visibility: 'user-only',
|
|
description: 'Your AWS Access Key ID',
|
|
},
|
|
secretAccessKey: {
|
|
type: 'string',
|
|
required: true,
|
|
visibility: 'user-only',
|
|
description: 'Your AWS Secret Access Key',
|
|
},
|
|
region: {
|
|
type: 'string',
|
|
required: true,
|
|
visibility: 'user-only',
|
|
description: 'AWS region to address the request to (e.g., us-east-1)',
|
|
},
|
|
prefix: {
|
|
type: 'string',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'Limit the response to bucket names that begin with this prefix',
|
|
},
|
|
maxBuckets: {
|
|
type: 'number',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'Maximum number of buckets to return (1-10000)',
|
|
},
|
|
continuationToken: {
|
|
type: 'string',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'Token for pagination from a previous list buckets response',
|
|
},
|
|
},
|
|
|
|
request: {
|
|
url: '/api/tools/s3/list-buckets',
|
|
method: 'POST',
|
|
headers: () => ({
|
|
'Content-Type': 'application/json',
|
|
}),
|
|
body: (params) => ({
|
|
accessKeyId: params.accessKeyId,
|
|
secretAccessKey: params.secretAccessKey,
|
|
region: params.region,
|
|
prefix: params.prefix,
|
|
maxBuckets: params.maxBuckets !== undefined ? Number(params.maxBuckets) : undefined,
|
|
continuationToken: params.continuationToken,
|
|
}),
|
|
},
|
|
|
|
transformResponse: async (response) => {
|
|
const data = await response.json()
|
|
|
|
if (!data.success) {
|
|
return {
|
|
success: false,
|
|
output: {
|
|
buckets: [],
|
|
metadata: {
|
|
error: data.error || 'Failed to list buckets',
|
|
},
|
|
},
|
|
error: data.error,
|
|
}
|
|
}
|
|
|
|
return {
|
|
success: true,
|
|
output: {
|
|
buckets: data.output.buckets || [],
|
|
metadata: {
|
|
owner: data.output.owner ?? null,
|
|
continuationToken: data.output.continuationToken ?? null,
|
|
prefix: data.output.prefix ?? null,
|
|
},
|
|
},
|
|
}
|
|
},
|
|
|
|
outputs: {
|
|
buckets: {
|
|
type: 'array',
|
|
description: 'List of S3 buckets owned by the account',
|
|
items: {
|
|
type: 'object',
|
|
properties: {
|
|
name: { type: 'string', description: 'Bucket name' },
|
|
creationDate: { type: 'string', description: 'Bucket creation timestamp' },
|
|
region: { type: 'string', description: 'AWS region where the bucket is located' },
|
|
},
|
|
},
|
|
},
|
|
metadata: {
|
|
type: 'object',
|
|
description: 'Listing metadata including owner and pagination info',
|
|
},
|
|
},
|
|
}
|