chore: import upstream snapshot with attribution
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
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
This commit is contained in:
@@ -0,0 +1,131 @@
|
||||
import type {
|
||||
LemlistGetActivitiesParams,
|
||||
LemlistGetActivitiesResponse,
|
||||
} from '@/tools/lemlist/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const getActivitiesTool: ToolConfig<
|
||||
LemlistGetActivitiesParams,
|
||||
LemlistGetActivitiesResponse
|
||||
> = {
|
||||
id: 'lemlist_get_activities',
|
||||
name: 'Lemlist Get Activities',
|
||||
description:
|
||||
'Retrieves campaign activities and steps performed, including email opens, clicks, replies, and other events.',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'Lemlist API key',
|
||||
},
|
||||
type: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Filter by activity type (e.g., emailOpened, emailClicked, emailReplied, paused)',
|
||||
},
|
||||
campaignId: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Filter by campaign ID (e.g., "cam_abc123def456")',
|
||||
},
|
||||
leadId: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Filter by lead ID (e.g., "lea_abc123def456")',
|
||||
},
|
||||
isFirst: {
|
||||
type: 'boolean',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Filter for first activity only',
|
||||
},
|
||||
limit: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Number of results per request (e.g., 50). Max 100, default 100',
|
||||
},
|
||||
offset: {
|
||||
type: 'number',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Number of records to skip for pagination (e.g., 0, 100, 200)',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const url = new URL('https://api.lemlist.com/api/activities')
|
||||
url.searchParams.append('version', 'v2')
|
||||
|
||||
if (params.type) url.searchParams.append('type', params.type)
|
||||
if (params.campaignId) url.searchParams.append('campaignId', params.campaignId)
|
||||
if (params.leadId) url.searchParams.append('leadId', params.leadId)
|
||||
if (params.isFirst !== undefined) url.searchParams.append('isFirst', String(params.isFirst))
|
||||
if (params.limit !== undefined) url.searchParams.append('limit', String(params.limit))
|
||||
if (params.offset !== undefined) url.searchParams.append('offset', String(params.offset))
|
||||
|
||||
return url.toString()
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => {
|
||||
const credentials = Buffer.from(`:${params.apiKey}`).toString('base64')
|
||||
return {
|
||||
Authorization: `Basic ${credentials}`,
|
||||
'Content-Type': 'application/json',
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
const data = await response.json()
|
||||
|
||||
const activities = Array.isArray(data) ? data : []
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
activities: activities.map((activity: Record<string, unknown>) => ({
|
||||
_id: (activity._id as string) ?? '',
|
||||
type: (activity.type as string) ?? '',
|
||||
leadId: (activity.leadId as string) ?? '',
|
||||
campaignId: (activity.campaignId as string) ?? '',
|
||||
sequenceId: (activity.sequenceId as string) ?? null,
|
||||
stepId: (activity.stepId as string) ?? null,
|
||||
createdAt: (activity.createdAt as string) ?? '',
|
||||
})),
|
||||
count: activities.length,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
activities: {
|
||||
type: 'array',
|
||||
description: 'List of activities',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
_id: { type: 'string', description: 'Activity ID' },
|
||||
type: { type: 'string', description: 'Activity type' },
|
||||
leadId: { type: 'string', description: 'Associated lead ID' },
|
||||
campaignId: { type: 'string', description: 'Campaign ID' },
|
||||
sequenceId: { type: 'string', description: 'Sequence ID', optional: true },
|
||||
stepId: { type: 'string', description: 'Step ID', optional: true },
|
||||
createdAt: { type: 'string', description: 'When the activity occurred' },
|
||||
},
|
||||
},
|
||||
},
|
||||
count: {
|
||||
type: 'number',
|
||||
description: 'Number of activities returned',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
import type { LemlistGetLeadParams, LemlistGetLeadResponse } from '@/tools/lemlist/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const getLeadTool: ToolConfig<LemlistGetLeadParams, LemlistGetLeadResponse> = {
|
||||
id: 'lemlist_get_lead',
|
||||
name: 'Lemlist Get Lead',
|
||||
description: 'Retrieves lead information by email address or lead ID.',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'Lemlist API key',
|
||||
},
|
||||
leadIdentifier: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Lead email address (e.g., "john@example.com") or lead ID (e.g., "lea_abc123def456")',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const identifier = params.leadIdentifier || ''
|
||||
const isEmail = identifier.includes('@')
|
||||
if (isEmail) {
|
||||
return `https://api.lemlist.com/api/leads/${encodeURIComponent(identifier)}`
|
||||
}
|
||||
return `https://api.lemlist.com/api/leads?id=${encodeURIComponent(identifier)}`
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => {
|
||||
const credentials = Buffer.from(`:${params.apiKey}`).toString('base64')
|
||||
return {
|
||||
Authorization: `Basic ${credentials}`,
|
||||
'Content-Type': 'application/json',
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
_id: data._id ?? '',
|
||||
email: data.email ?? '',
|
||||
firstName: data.firstName ?? null,
|
||||
lastName: data.lastName ?? null,
|
||||
companyName: data.companyName ?? null,
|
||||
jobTitle: data.jobTitle ?? null,
|
||||
companyDomain: data.companyDomain ?? null,
|
||||
isPaused: data.isPaused ?? false,
|
||||
campaignId: data.campaignId ?? null,
|
||||
contactId: data.contactId ?? null,
|
||||
emailStatus: data.emailStatus ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
_id: {
|
||||
type: 'string',
|
||||
description: 'Lead ID',
|
||||
},
|
||||
email: {
|
||||
type: 'string',
|
||||
description: 'Lead email address',
|
||||
},
|
||||
firstName: {
|
||||
type: 'string',
|
||||
description: 'Lead first name',
|
||||
optional: true,
|
||||
},
|
||||
lastName: {
|
||||
type: 'string',
|
||||
description: 'Lead last name',
|
||||
optional: true,
|
||||
},
|
||||
companyName: {
|
||||
type: 'string',
|
||||
description: 'Company name',
|
||||
optional: true,
|
||||
},
|
||||
jobTitle: {
|
||||
type: 'string',
|
||||
description: 'Job title',
|
||||
optional: true,
|
||||
},
|
||||
companyDomain: {
|
||||
type: 'string',
|
||||
description: 'Company domain',
|
||||
optional: true,
|
||||
},
|
||||
isPaused: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the lead is paused',
|
||||
},
|
||||
campaignId: {
|
||||
type: 'string',
|
||||
description: 'Campaign ID the lead belongs to',
|
||||
optional: true,
|
||||
},
|
||||
contactId: {
|
||||
type: 'string',
|
||||
description: 'Contact ID',
|
||||
optional: true,
|
||||
},
|
||||
emailStatus: {
|
||||
type: 'string',
|
||||
description: 'Email deliverability status',
|
||||
optional: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
export { getActivitiesTool as lemlistGetActivitiesTool } from '@/tools/lemlist/get_activities'
|
||||
export { getLeadTool as lemlistGetLeadTool } from '@/tools/lemlist/get_lead'
|
||||
export { sendEmailTool as lemlistSendEmailTool } from '@/tools/lemlist/send_email'
|
||||
export * from './types'
|
||||
@@ -0,0 +1,106 @@
|
||||
import type { LemlistSendEmailParams, LemlistSendEmailResponse } from '@/tools/lemlist/types'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const sendEmailTool: ToolConfig<LemlistSendEmailParams, LemlistSendEmailResponse> = {
|
||||
id: 'lemlist_send_email',
|
||||
name: 'Lemlist Send Email',
|
||||
description: 'Sends an email to a contact through the Lemlist inbox.',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
apiKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'Lemlist API key',
|
||||
},
|
||||
sendUserId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Identifier for the user sending the message (e.g., "usr_abc123def456")',
|
||||
},
|
||||
sendUserEmail: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Email address of the sender (e.g., "sales@company.com")',
|
||||
},
|
||||
sendUserMailboxId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Mailbox identifier for the sender (e.g., "mbx_abc123def456")',
|
||||
},
|
||||
contactId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Recipient contact identifier (e.g., "con_abc123def456")',
|
||||
},
|
||||
leadId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Associated lead identifier (e.g., "lea_abc123def456")',
|
||||
},
|
||||
subject: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Email subject line',
|
||||
},
|
||||
message: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Email message body in HTML format',
|
||||
},
|
||||
cc: {
|
||||
type: 'json',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Array of CC email addresses',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: () => 'https://api.lemlist.com/api/inbox/email',
|
||||
method: 'POST',
|
||||
headers: (params) => {
|
||||
const credentials = Buffer.from(`:${params.apiKey}`).toString('base64')
|
||||
return {
|
||||
Authorization: `Basic ${credentials}`,
|
||||
'Content-Type': 'application/json',
|
||||
}
|
||||
},
|
||||
body: (params) => ({
|
||||
sendUserId: params.sendUserId?.trim(),
|
||||
sendUserEmail: params.sendUserEmail?.trim(),
|
||||
sendUserMailboxId: params.sendUserMailboxId?.trim(),
|
||||
contactId: params.contactId?.trim(),
|
||||
leadId: params.leadId?.trim(),
|
||||
subject: params.subject?.trim(),
|
||||
message: params.message,
|
||||
cc: params.cc ?? [],
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
const data = await response.json()
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
ok: data.ok ?? true,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
ok: {
|
||||
type: 'boolean',
|
||||
description: 'Whether the email was sent successfully',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
import type { ToolResponse } from '@/tools/types'
|
||||
|
||||
interface LemlistBaseParams {
|
||||
apiKey: string
|
||||
}
|
||||
|
||||
export interface LemlistGetActivitiesParams extends LemlistBaseParams {
|
||||
type?: string
|
||||
campaignId?: string
|
||||
leadId?: string
|
||||
isFirst?: boolean
|
||||
limit?: number
|
||||
offset?: number
|
||||
}
|
||||
|
||||
interface LemlistActivity {
|
||||
_id: string
|
||||
type: string
|
||||
leadId: string
|
||||
campaignId: string
|
||||
sequenceId: string | null
|
||||
stepId: string | null
|
||||
createdAt: string
|
||||
}
|
||||
|
||||
export interface LemlistGetActivitiesResponse extends ToolResponse {
|
||||
output: {
|
||||
activities: LemlistActivity[]
|
||||
count: number
|
||||
}
|
||||
}
|
||||
|
||||
export interface LemlistGetLeadParams extends LemlistBaseParams {
|
||||
leadIdentifier: string
|
||||
}
|
||||
|
||||
interface LemlistLead {
|
||||
_id: string
|
||||
email: string
|
||||
firstName: string | null
|
||||
lastName: string | null
|
||||
companyName: string | null
|
||||
jobTitle: string | null
|
||||
companyDomain: string | null
|
||||
isPaused: boolean
|
||||
campaignId: string | null
|
||||
contactId: string | null
|
||||
emailStatus: string | null
|
||||
}
|
||||
|
||||
export interface LemlistGetLeadResponse extends ToolResponse {
|
||||
output: LemlistLead
|
||||
}
|
||||
|
||||
export interface LemlistSendEmailParams extends LemlistBaseParams {
|
||||
sendUserId: string
|
||||
sendUserEmail: string
|
||||
sendUserMailboxId: string
|
||||
contactId: string
|
||||
leadId: string
|
||||
subject: string
|
||||
message: string
|
||||
cc?: string[]
|
||||
}
|
||||
|
||||
export interface LemlistSendEmailResponse extends ToolResponse {
|
||||
output: {
|
||||
ok: boolean
|
||||
}
|
||||
}
|
||||
|
||||
export type LemlistResponse =
|
||||
| LemlistGetActivitiesResponse
|
||||
| LemlistGetLeadResponse
|
||||
| LemlistSendEmailResponse
|
||||
Reference in New Issue
Block a user