chore: import upstream snapshot with attribution
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
Publish CLI Package / publish-npm (push) Has been cancelled
Publish Python SDK / publish-pypi (push) Has been cancelled
Publish TypeScript SDK / publish-npm (push) Has been cancelled

This commit is contained in:
wehub-resource-sync
2026-07-13 13:20:55 +08:00
commit d25d482dc2
13754 changed files with 4996608 additions and 0 deletions
@@ -0,0 +1,184 @@
import { filterUndefined } from '@sim/utils/object'
import type {
SendblueSendGroupMessageParams,
SendblueSendGroupMessageResponse,
} from '@/tools/sendblue/types'
import {
SENDBLUE_API_BASE_URL,
sendblueBaseParamFields,
sendblueHeaders,
} from '@/tools/sendblue/utils'
import type { ToolConfig } from '@/tools/types'
export const sendblueSendGroupMessageTool: ToolConfig<
SendblueSendGroupMessageParams,
SendblueSendGroupMessageResponse
> = {
id: 'sendblue_send_group_message',
name: 'Sendblue Send Group Message',
description: 'Send an iMessage or SMS to a group of recipients via Sendblue.',
version: '1.0.0',
params: {
...sendblueBaseParamFields,
numbers: {
type: 'array',
required: false,
visibility: 'user-or-llm',
description:
'Recipient phone numbers in E.164 format (e.g., ["+19998887777", "+13334445555"]). Optional when sending to an existing group via group_id.',
items: { type: 'string', description: 'Phone number in E.164 format' },
},
from_number: {
type: 'string',
required: true,
visibility: 'user-or-llm',
description:
'One of your registered Sendblue phone numbers to send from, in E.164 format (e.g., +18887776666)',
},
content: {
type: 'string',
required: false,
visibility: 'user-or-llm',
description: 'Message text content. Either content or media_url must be provided.',
},
media_url: {
type: 'string',
required: false,
visibility: 'user-or-llm',
description: 'URL of a media file to send. Either content or media_url must be provided.',
},
send_style: {
type: 'string',
required: false,
visibility: 'user-or-llm',
description:
'iMessage expressive style (e.g., celebration, fireworks, lasers, confetti, balloons, invisible, slam).',
},
seat_id: {
type: 'string',
required: false,
visibility: 'user-or-llm',
description:
'Seat (user) the message is attributed to. Accepts the seat UUID or Firebase Auth subject.',
},
group_id: {
type: 'string',
required: false,
visibility: 'user-or-llm',
description: 'Unique identifier of an existing group to send to. Omit to start a new group.',
},
status_callback: {
type: 'string',
required: false,
visibility: 'user-only',
description: 'Webhook URL that Sendblue will POST message status updates to.',
},
},
request: {
url: `${SENDBLUE_API_BASE_URL}/api/send-group-message`,
method: 'POST',
headers: (params) => sendblueHeaders(params),
body: (params) => {
const numbers = Array.isArray(params.numbers)
? params.numbers.map((n) => n.trim()).filter(Boolean)
: undefined
const hasNumbers = numbers !== undefined && numbers.length > 0
const hasGroupId = typeof params.group_id === 'string' && params.group_id.trim().length > 0
if (!hasNumbers && !hasGroupId) {
throw new Error(
'Provide either "numbers" to start a new group or "group_id" to message an existing group.'
)
}
return filterUndefined({
numbers: hasNumbers ? numbers : undefined,
from_number: params.from_number,
content: params.content,
media_url: params.media_url,
send_style: params.send_style,
seat_id: params.seat_id,
group_id: hasGroupId ? params.group_id?.trim() : undefined,
status_callback: params.status_callback,
})
},
},
transformResponse: async (response) => {
const data = await response.json()
return {
success: true,
output: {
status: data.status ?? null,
message_handle: data.message_handle ?? null,
account_email: data.account_email ?? data.accountEmail ?? null,
content: data.content ?? null,
is_outbound: data.is_outbound ?? null,
from_number: data.from_number ?? null,
number: data.number ?? null,
media_url: data.media_url ?? null,
send_style: data.send_style ?? null,
seat_id: data.seat_id ?? null,
sender_email: data.sender_email ?? null,
error_code: data.error_code ?? null,
error_message: data.error_message ?? null,
date_created: data.date_created ?? null,
date_updated: data.date_updated ?? null,
group_id: data.group_id ?? null,
participants: data.participants ?? [],
},
}
},
outputs: {
status: { type: 'string', description: 'Message status: QUEUED, SENT, DELIVERED, or ERROR' },
message_handle: { type: 'string', description: 'Unique identifier for tracking the message' },
group_id: {
type: 'string',
description: 'Identifier of the group the message was sent to',
optional: true,
},
participants: {
type: 'array',
description: 'Phone numbers participating in the group',
items: { type: 'string' },
},
account_email: { type: 'string', description: 'Email of the account that sent the message' },
content: { type: 'string', description: 'Message content', optional: true },
is_outbound: { type: 'boolean', description: 'Whether this is an outbound message' },
from_number: { type: 'string', description: 'Sending phone number' },
number: { type: 'string', description: 'Recipient phone number', optional: true },
media_url: { type: 'string', description: 'URL of attached media', optional: true },
send_style: {
type: 'string',
description: 'iMessage expressive style applied',
optional: true,
},
seat_id: {
type: 'string',
description: 'UUID of the seat that sent the message',
optional: true,
},
sender_email: {
type: 'string',
description: 'Email of the seat (user) that sent the message',
optional: true,
},
error_code: {
type: 'number',
description: 'Numeric error code if the message failed',
optional: true,
},
error_message: {
type: 'string',
description: 'Error message if the message failed',
optional: true,
},
date_created: { type: 'string', description: 'When the message was created', optional: true },
date_updated: {
type: 'string',
description: 'When the message was last updated',
optional: true,
},
},
}