Files
wehub-resource-sync 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
chore: import upstream snapshot with attribution
2026-07-13 13:20:55 +08:00

108 lines
3.7 KiB
TypeScript

import type { HunterEnrichmentParams, HunterEnrichmentResponse } from '@/tools/hunter/types'
import { HUNTER_API_KEY_PREFIX } from '@/tools/hunter/types'
import type { ToolConfig } from '@/tools/types'
export const companiesFindTool: ToolConfig<HunterEnrichmentParams, HunterEnrichmentResponse> = {
id: 'hunter_companies_find',
name: 'Hunter Companies Find',
description: 'Enriches company data using domain name.',
version: '1.0.0',
hosting: {
envKeyPrefix: HUNTER_API_KEY_PREFIX,
apiKeyParam: 'apiKey',
byokProviderId: 'hunter',
// Companies Find (enrichment) is free on Hunter — no credits consumed.
pricing: { type: 'per_request', cost: 0 },
rateLimit: {
mode: 'per_request',
requestsPerMinute: 60,
},
},
params: {
domain: {
type: 'string',
required: true,
visibility: 'user-or-llm',
description: 'Domain to find company data for (e.g., "stripe.com", "company.io")',
},
apiKey: {
type: 'string',
required: true,
visibility: 'user-only',
description: 'Hunter.io API Key',
},
},
request: {
url: (params) => {
const url = new URL('https://api.hunter.io/v2/companies/find')
url.searchParams.append('api_key', params.apiKey)
url.searchParams.append('domain', params.domain || '')
return url.toString()
},
method: 'GET',
headers: () => ({
'Content-Type': 'application/json',
}),
},
transformResponse: async (response: Response) => {
const data = await response.json()
const c = data.data ?? {}
return {
success: true,
output: {
name: c.name ?? '',
domain: c.domain ?? '',
description: c.description ?? '',
industry: c.category?.industry ?? '',
sector: c.category?.sector ?? '',
size:
c.metrics?.employeesRange ??
(c.metrics?.employees != null ? String(c.metrics.employees) : ''),
founded_year: c.foundedYear ?? null,
location: c.location ?? '',
country: c.geo?.country ?? '',
country_code: c.geo?.countryCode ?? '',
state: c.geo?.state ?? '',
city: c.geo?.city ?? '',
linkedin: c.linkedin?.handle ?? '',
twitter: c.twitter?.handle ?? '',
facebook: c.facebook?.handle ?? '',
logo: c.logo ?? '',
phone: c.phone ?? '',
tech: c.tech ?? [],
},
}
},
outputs: {
name: { type: 'string', description: 'Company name' },
domain: { type: 'string', description: 'Company domain' },
description: { type: 'string', description: 'Company description' },
industry: { type: 'string', description: 'Industry classification' },
sector: { type: 'string', description: 'Business sector' },
size: { type: 'string', description: 'Employee headcount range (e.g., "11-50")' },
founded_year: { type: 'number', description: 'Year founded', optional: true },
location: { type: 'string', description: 'Headquarters location (formatted)' },
country: { type: 'string', description: 'Country (full name)' },
country_code: { type: 'string', description: 'ISO 3166-1 alpha-2 country code' },
state: { type: 'string', description: 'State/province' },
city: { type: 'string', description: 'City' },
linkedin: { type: 'string', description: 'LinkedIn handle (e.g., company/hunterio)' },
twitter: { type: 'string', description: 'Twitter handle' },
facebook: { type: 'string', description: 'Facebook handle' },
logo: { type: 'string', description: 'Company logo URL' },
phone: { type: 'string', description: 'Company phone number' },
tech: {
type: 'array',
description: 'Technologies used by the company',
items: { type: 'string', description: 'Technology name' },
},
},
}