Files
WeHub Mirror 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
WeHub snapshot of cb28d14c6f2c081de7a0d8729a8c816c9adef67a
2026-08-10 11:17:50 +08:00

125 lines
3.5 KiB
TypeScript

import type { HunterEmailCountParams, HunterEmailCountResponse } from '@/tools/hunter/types'
import { DEPARTMENT_OUTPUT, HUNTER_API_KEY_PREFIX, SENIORITY_OUTPUT } from '@/tools/hunter/types'
import type { ToolConfig } from '@/tools/types'
export const emailCountTool: ToolConfig<HunterEmailCountParams, HunterEmailCountResponse> = {
id: 'hunter_email_count',
name: 'Hunter Email Count',
description: 'Returns the total number of email addresses found for a domain or company.',
version: '1.0.0',
hosting: {
envKeyPrefix: HUNTER_API_KEY_PREFIX,
apiKeyParam: 'apiKey',
byokProviderId: 'hunter',
// Email Count is free on Hunter — no credits consumed.
pricing: { type: 'per_request', cost: 0 },
rateLimit: {
mode: 'per_request',
requestsPerMinute: 60,
},
},
params: {
domain: {
type: 'string',
required: false,
visibility: 'user-or-llm',
description:
'Domain to count emails for (e.g., "stripe.com"). Required if company not provided',
},
company: {
type: 'string',
required: false,
visibility: 'user-or-llm',
description:
'Company name to count emails for (e.g., "Stripe", "Acme Inc"). Required if domain not provided',
},
type: {
type: 'string',
required: false,
visibility: 'user-or-llm',
description:
'Filter for personal or generic emails only (e.g., "personal", "generic", "all")',
},
apiKey: {
type: 'string',
required: true,
visibility: 'user-only',
description: 'Hunter.io API Key',
},
},
request: {
url: (params) => {
if (!params.domain && !params.company) {
throw new Error('Either domain or company must be provided')
}
const url = new URL('https://api.hunter.io/v2/email-count')
url.searchParams.append('api_key', params.apiKey)
if (params.domain) url.searchParams.append('domain', params.domain)
if (params.company) url.searchParams.append('company', params.company)
if (params.type && params.type !== 'all') url.searchParams.append('type', params.type)
return url.toString()
},
method: 'GET',
headers: () => ({
'Content-Type': 'application/json',
}),
},
transformResponse: async (response: Response) => {
const data = await response.json()
return {
success: true,
output: {
total: data.data?.total || 0,
personal_emails: data.data?.personal_emails || 0,
generic_emails: data.data?.generic_emails || 0,
department: data.data?.department || {
executive: 0,
it: 0,
finance: 0,
management: 0,
sales: 0,
legal: 0,
support: 0,
hr: 0,
marketing: 0,
communication: 0,
education: 0,
design: 0,
health: 0,
operations: 0,
},
seniority: data.data?.seniority || {
junior: 0,
senior: 0,
executive: 0,
},
},
}
},
outputs: {
total: {
type: 'number',
description: 'Total number of email addresses found',
},
personal_emails: {
type: 'number',
description: 'Number of personal email addresses (individual employees)',
},
generic_emails: {
type: 'number',
description: 'Number of generic/role-based email addresses (e.g., contact@, info@)',
},
department: DEPARTMENT_OUTPUT,
seniority: SENIORITY_OUTPUT,
},
}