@elevasis/core 0.28.0 → 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/auth/index.d.ts +5289 -0
  2. package/dist/auth/index.js +595 -0
  3. package/dist/index.d.ts +11 -11
  4. package/dist/knowledge/index.d.ts +1 -1
  5. package/dist/organization-model/index.d.ts +11 -11
  6. package/dist/test-utils/index.d.ts +24 -1
  7. package/package.json +7 -3
  8. package/src/__tests__/publish.test.ts +8 -7
  9. package/src/auth/__tests__/access-key-coverage.test.ts +42 -0
  10. package/src/auth/__tests__/access-key-scan.ts +117 -0
  11. package/src/auth/__tests__/access-keys.test.ts +81 -0
  12. package/src/auth/__tests__/access-model.test.ts +257 -0
  13. package/src/auth/__tests__/access-test-fixtures.ts +50 -0
  14. package/src/auth/__tests__/key-catalog-drift.test.ts +33 -0
  15. package/src/auth/__tests__/platform-admin-bypass-parity.test.ts +67 -0
  16. package/src/auth/access-keys.ts +173 -0
  17. package/src/auth/access-model.ts +185 -0
  18. package/src/auth/index.ts +6 -2
  19. package/src/auth/multi-tenancy/memberships/membership.ts +2 -4
  20. package/src/auth/multi-tenancy/permissions.ts +1 -1
  21. package/src/auth/multi-tenancy/types.ts +3 -12
  22. package/src/business/acquisition/api-schemas.test.ts +59 -8
  23. package/src/business/acquisition/api-schemas.ts +10 -5
  24. package/src/business/acquisition/build-templates.test.ts +187 -240
  25. package/src/business/acquisition/build-templates.ts +87 -98
  26. package/src/business/acquisition/types.ts +390 -389
  27. package/src/execution/engine/index.ts +6 -4
  28. package/src/execution/engine/tools/lead-service-types.ts +63 -34
  29. package/src/execution/engine/tools/platform/acquisition/types.ts +7 -8
  30. package/src/execution/engine/tools/registry.ts +6 -4
  31. package/src/execution/engine/tools/tool-maps.ts +23 -1
  32. package/src/organization-model/domains/prospecting.ts +2 -327
  33. package/src/organization-model/migration-helpers.ts +16 -12
  34. package/src/reference/_generated/contracts.md +352 -328
  35. package/src/reference/glossary.md +8 -6
  36. package/src/supabase/database.types.ts +13 -0
@@ -1368,77 +1368,77 @@ export interface DeploymentSpec {
1368
1368
  ### `AcqCompany`
1369
1369
 
1370
1370
  ```typescript
1371
- /**
1372
- * Company record in the acquisition database.
1373
- * Contains enriched company data from various sources.
1374
- * Transformed from AcqCompanyRow with camelCase properties.
1375
- */
1376
- export interface AcqCompany {
1377
- id: string
1378
- organizationId: string
1379
- name: string
1380
- domain: string | null
1381
- linkedinUrl: string | null
1382
- website: string | null
1383
- numEmployees: number | null
1384
- foundedYear: number | null
1385
- locationCity: string | null
1386
- locationState: string | null
1387
- category: string | null
1388
- categoryPain: string | null
1389
- segment: string | null
1390
- processingState: CompanyProcessingState | null
1391
- /** @deprecated Use `processingState`. This legacy DB column has been removed; responses return null. */
1392
- pipelineStatus?: LegacyPipelineStatus | null
1393
- enrichmentData: CompanyEnrichmentData | null
1394
- source: string | null
1395
- batchId: string | null
1396
- status: 'active' | 'invalid'
1397
- verticalResearch: string | null
1398
- /** Track A: flat qualification score (null until a scoring rubric is defined). Added by W1 migration. */
1399
- qualificationScore: number | null
1400
- /** Track A: flat qualification signals jsonb preserving the result payload shape. Added by W1 migration. */
1401
- qualificationSignals: Record<string, unknown> | null
1402
- /** Track A: key identifying the rubric used for qualification. Added by W1 migration. */
1403
- qualificationRubricKey: string | null
1404
- createdAt: Date
1405
- updatedAt: Date
1371
+ /**
1372
+ * Company record in the acquisition database.
1373
+ * Contains enriched company data from various sources.
1374
+ * Transformed from AcqCompanyRow with camelCase properties.
1375
+ */
1376
+ export interface AcqCompany {
1377
+ id: string
1378
+ organizationId: string
1379
+ name: string
1380
+ domain: string | null
1381
+ linkedinUrl: string | null
1382
+ website: string | null
1383
+ numEmployees: number | null
1384
+ foundedYear: number | null
1385
+ locationCity: string | null
1386
+ locationState: string | null
1387
+ category: string | null
1388
+ categoryPain: string | null
1389
+ segment: string | null
1390
+ processingState: CompanyProcessingState | null
1391
+ /** @deprecated Use `processingState`. This legacy DB column has been removed; responses return null. */
1392
+ pipelineStatus?: LegacyPipelineStatus | null
1393
+ enrichmentData: CompanyEnrichmentData | null
1394
+ source: string | null
1395
+ batchId: string | null
1396
+ status: 'active' | 'invalid'
1397
+ verticalResearch: string | null
1398
+ /** Track A: flat qualification score (null until a scoring rubric is defined). Added by W1 migration. */
1399
+ qualificationScore: number | null
1400
+ /** Track A: flat qualification signals jsonb preserving the result payload shape. Added by W1 migration. */
1401
+ qualificationSignals: Record<string, unknown> | null
1402
+ /** Track A: key identifying the rubric used for qualification. Added by W1 migration. */
1403
+ qualificationRubricKey: string | null
1404
+ createdAt: Date
1405
+ updatedAt: Date
1406
1406
  }
1407
1407
  ```
1408
1408
 
1409
1409
  ### `AcqContact`
1410
1410
 
1411
1411
  ```typescript
1412
- /**
1413
- * Contact record in the acquisition database.
1414
- * Contains enriched contact data and personalization content.
1415
- * Transformed from AcqContactRow with camelCase properties.
1416
- */
1417
- export interface AcqContact {
1418
- id: string
1419
- organizationId: string
1420
- companyId: string | null
1421
- email: string
1422
- emailValid: 'VALID' | 'INVALID' | 'RISKY' | 'UNKNOWN' | null
1423
- firstName: string | null
1424
- lastName: string | null
1425
- linkedinUrl: string | null
1426
- title: string | null
1427
- headline: string | null
1428
- filterReason: string | null
1429
- openingLine: string | null
1430
- source: string | null
1431
- sourceId: string | null
1432
- processingState: ContactProcessingState | null
1433
- /** @deprecated Use `processingState`. This legacy DB column has been removed; responses return null. */
1434
- pipelineStatus?: LegacyPipelineStatus | null
1435
- enrichmentData: ContactEnrichmentData | null
1436
- /** Attio Person record ID - set when contact responds and is added to CRM */
1437
- attioPersonId: string | null
1438
- batchId: string | null
1439
- status: 'active' | 'invalid'
1440
- createdAt: Date
1441
- updatedAt: Date
1412
+ /**
1413
+ * Contact record in the acquisition database.
1414
+ * Contains enriched contact data and personalization content.
1415
+ * Transformed from AcqContactRow with camelCase properties.
1416
+ */
1417
+ export interface AcqContact {
1418
+ id: string
1419
+ organizationId: string
1420
+ companyId: string | null
1421
+ email: string
1422
+ emailValid: 'VALID' | 'INVALID' | 'RISKY' | 'UNKNOWN' | null
1423
+ firstName: string | null
1424
+ lastName: string | null
1425
+ linkedinUrl: string | null
1426
+ title: string | null
1427
+ headline: string | null
1428
+ filterReason: string | null
1429
+ openingLine: string | null
1430
+ source: string | null
1431
+ sourceId: string | null
1432
+ processingState: ContactProcessingState | null
1433
+ /** @deprecated Use `processingState`. This legacy DB column has been removed; responses return null. */
1434
+ pipelineStatus?: LegacyPipelineStatus | null
1435
+ enrichmentData: ContactEnrichmentData | null
1436
+ /** Attio Person record ID - set when contact responds and is added to CRM */
1437
+ attioPersonId: string | null
1438
+ batchId: string | null
1439
+ status: 'active' | 'invalid'
1440
+ createdAt: Date
1441
+ updatedAt: Date
1442
1442
  }
1443
1443
  ```
1444
1444
 
@@ -1457,23 +1457,23 @@ export type DealPriorityBucketKey = 'needs_response' | 'follow_up_due' | 'waitin
1457
1457
  ### `DealPriority`
1458
1458
 
1459
1459
  ```typescript
1460
- export interface DealPriority {
1461
- bucketKey: DealPriorityBucketKey
1462
- rank: number
1463
- label: string
1464
- color: string
1465
- reason: string
1466
- latestActivityAt: string | null
1467
- nextActionAt: string | null
1460
+ export interface DealPriority {
1461
+ bucketKey: DealPriorityBucketKey
1462
+ rank: number
1463
+ label: string
1464
+ color: string
1465
+ reason: string
1466
+ latestActivityAt: string | null
1467
+ nextActionAt: string | null
1468
1468
  }
1469
1469
  ```
1470
1470
 
1471
1471
  ### `KanbanStageConfig`
1472
1472
 
1473
1473
  ```typescript
1474
- export interface KanbanStageConfig {
1475
- color: string // Mantine color token (e.g. 'blue', 'teal')
1476
- label?: string // Optional display label override
1474
+ export interface KanbanStageConfig {
1475
+ color: string // Mantine color token (e.g. 'blue', 'teal')
1476
+ label?: string // Optional display label override
1477
1477
  }
1478
1478
  ```
1479
1479
 
@@ -1486,49 +1486,49 @@ export type KanbanBoardConfig = Partial<Record<DealStage, KanbanStageConfig>>
1486
1486
  ### `DealContact`
1487
1487
 
1488
1488
  ```typescript
1489
- export interface DealContact {
1490
- id: string
1491
- first_name: string | null
1492
- last_name: string | null
1493
- email: string
1494
- title: string | null
1495
- headline: string | null
1496
- linkedin_url: string | null
1497
- processing_state: Record<string, unknown> | null
1498
- enrichment_data: Record<string, unknown> | null
1499
- company: {
1500
- id: string
1501
- name: string
1502
- domain: string | null
1503
- website: string | null
1504
- linkedin_url: string | null
1505
- segment: string | null
1506
- category: string | null
1507
- num_employees: number | null
1508
- } | null
1489
+ export interface DealContact {
1490
+ id: string
1491
+ first_name: string | null
1492
+ last_name: string | null
1493
+ email: string
1494
+ title: string | null
1495
+ headline: string | null
1496
+ linkedin_url: string | null
1497
+ processing_state: Record<string, unknown> | null
1498
+ enrichment_data: Record<string, unknown> | null
1499
+ company: {
1500
+ id: string
1501
+ name: string
1502
+ domain: string | null
1503
+ website: string | null
1504
+ linkedin_url: string | null
1505
+ segment: string | null
1506
+ category: string | null
1507
+ num_employees: number | null
1508
+ } | null
1509
1509
  }
1510
1510
  ```
1511
1511
 
1512
1512
  ### `DealFilters`
1513
1513
 
1514
1514
  ```typescript
1515
- export interface DealFilters {
1516
- stage?: DealStage
1517
- search?: string
1518
- limit?: number
1519
- offset?: number
1515
+ export interface DealFilters {
1516
+ stage?: DealStage
1517
+ search?: string
1518
+ limit?: number
1519
+ offset?: number
1520
1520
  }
1521
1521
  ```
1522
1522
 
1523
1523
  ### `DealListItem`
1524
1524
 
1525
1525
  ```typescript
1526
- /** Deal list item with joined contact and company data */
1527
- export interface DealListItem extends AcqDealRow {
1528
- priority: DealPriority
1529
- ownership: 'us' | 'them' | null
1530
- nextAction: string | null
1531
- contact: DealContact | null
1526
+ /** Deal list item with joined contact and company data */
1527
+ export interface DealListItem extends AcqDealRow {
1528
+ priority: DealPriority
1529
+ ownership: 'us' | 'them' | null
1530
+ nextAction: string | null
1531
+ contact: DealContact | null
1532
1532
  }
1533
1533
  ```
1534
1534
 
@@ -1541,31 +1541,31 @@ export type DealDetail = DealListItem
1541
1541
  ### `AcqDealTaskKind`
1542
1542
 
1543
1543
  ```typescript
1544
- /** Task kind options for a deal task (human follow-up action type) */
1544
+ /** Task kind options for a deal task (human follow-up action type) */
1545
1545
  export type AcqDealTaskKind = 'call' | 'email' | 'meeting' | 'other'
1546
1546
  ```
1547
1547
 
1548
1548
  ### `AcqDealTask`
1549
1549
 
1550
1550
  ```typescript
1551
- /**
1552
- * A CRM to-do item attached to a deal representing a human follow-up action.
1553
- * Transformed from AcqDealTaskRow with camelCase properties.
1554
- */
1555
- export interface AcqDealTask {
1556
- id: string
1557
- organizationId: string
1558
- dealId: string
1559
- title: string
1560
- description: string | null
1561
- kind: AcqDealTaskKind
1562
- dueAt: string | null
1563
- assigneeUserId: string | null
1564
- completedAt: string | null
1565
- completedByUserId: string | null
1566
- createdAt: string
1567
- updatedAt: string
1568
- createdByUserId: string | null
1551
+ /**
1552
+ * A CRM to-do item attached to a deal representing a human follow-up action.
1553
+ * Transformed from AcqDealTaskRow with camelCase properties.
1554
+ */
1555
+ export interface AcqDealTask {
1556
+ id: string
1557
+ organizationId: string
1558
+ dealId: string
1559
+ title: string
1560
+ description: string | null
1561
+ kind: AcqDealTaskKind
1562
+ dueAt: string | null
1563
+ assigneeUserId: string | null
1564
+ completedAt: string | null
1565
+ completedByUserId: string | null
1566
+ createdAt: string
1567
+ updatedAt: string
1568
+ createdByUserId: string | null
1569
1569
  }
1570
1570
  ```
1571
1571
 
@@ -1979,222 +1979,222 @@ export type CrmToolMap = {
1979
1979
  ### `WebPost`
1980
1980
 
1981
1981
  ```typescript
1982
- /**
1983
- * Represents a web post from company website scraping.
1984
- * Used for recent blog posts, news, or announcements.
1985
- */
1986
- export interface WebPost {
1987
- /** ISO date string of when the post was published */
1988
- date: string
1989
- /** Title of the web post */
1990
- title: string
1991
- /** Brief summary of the post content */
1992
- summary: string
1993
- /** AI-generated insight about the post's relevance */
1994
- aiInsight?: string
1982
+ /**
1983
+ * Represents a web post from company website scraping.
1984
+ * Used for recent blog posts, news, or announcements.
1985
+ */
1986
+ export interface WebPost {
1987
+ /** ISO date string of when the post was published */
1988
+ date: string
1989
+ /** Title of the web post */
1990
+ title: string
1991
+ /** Brief summary of the post content */
1992
+ summary: string
1993
+ /** AI-generated insight about the post's relevance */
1994
+ aiInsight?: string
1995
1995
  }
1996
1996
  ```
1997
1997
 
1998
1998
  ### `CompanyEnrichmentData`
1999
1999
 
2000
2000
  ```typescript
2001
- /**
2002
- * Enrichment data collected for a company from various sources.
2003
- */
2004
- export interface CompanyEnrichmentData {
2005
- googleMaps?: {
2006
- placeId?: string
2007
- totalScore?: number
2008
- reviewsCount?: number
2009
- address?: string
2010
- phone?: string
2011
- categoryName?: string
2012
- googleMapsUrl?: string
2013
- scrapedAt?: string
2014
- }
2015
- websiteCrawl?: {
2016
- companyDescription?: string
2017
- services?: string[]
2018
- specialties?: string[]
2019
- staff?: Array<{ name: string; title?: string; email?: string }>
2020
- automationGaps?: string[]
2021
- targetAudience?: string
2022
- category?: string
2023
- segment?: string
2024
- recentWin?: string
2025
- emailCount?: number
2026
- pageCount?: number
2027
- totalChars?: number
2028
- crawledAt?: string
2029
- extractedAt?: string
2030
- }
2031
- website?: {
2032
- missionVision?: string
2033
- uniqueAttributes?: string
2034
- coreOfferings?: string
2035
- targetAudience?: string
2036
- companyValues?: string
2037
- businessDescription?: string
2038
- recentPosts?: Array<{ date?: string; title?: string; summary?: string; aiInsight?: string }>
2039
- }
2040
- tomba?: {
2041
- waterfallEmail?: {
2042
- email: string
2043
- name?: string
2044
- title?: string
2045
- department?: string
2046
- } | null
2047
- genericEmail?: string | null
2048
- totalFound?: number
2049
- searchedAt?: string
2050
- }
2001
+ /**
2002
+ * Enrichment data collected for a company from various sources.
2003
+ */
2004
+ export interface CompanyEnrichmentData {
2005
+ googleMaps?: {
2006
+ placeId?: string
2007
+ totalScore?: number
2008
+ reviewsCount?: number
2009
+ address?: string
2010
+ phone?: string
2011
+ categoryName?: string
2012
+ googleMapsUrl?: string
2013
+ scrapedAt?: string
2014
+ }
2015
+ websiteCrawl?: {
2016
+ companyDescription?: string
2017
+ services?: string[]
2018
+ specialties?: string[]
2019
+ staff?: Array<{ name: string; title?: string; email?: string }>
2020
+ automationGaps?: string[]
2021
+ targetAudience?: string
2022
+ category?: string
2023
+ segment?: string
2024
+ recentWin?: string
2025
+ emailCount?: number
2026
+ pageCount?: number
2027
+ totalChars?: number
2028
+ crawledAt?: string
2029
+ extractedAt?: string
2030
+ }
2031
+ website?: {
2032
+ missionVision?: string
2033
+ uniqueAttributes?: string
2034
+ coreOfferings?: string
2035
+ targetAudience?: string
2036
+ companyValues?: string
2037
+ businessDescription?: string
2038
+ recentPosts?: Array<{ date?: string; title?: string; summary?: string; aiInsight?: string }>
2039
+ }
2040
+ tomba?: {
2041
+ waterfallEmail?: {
2042
+ email: string
2043
+ name?: string
2044
+ title?: string
2045
+ department?: string
2046
+ } | null
2047
+ genericEmail?: string | null
2048
+ totalFound?: number
2049
+ searchedAt?: string
2050
+ }
2051
2051
  }
2052
2052
  ```
2053
2053
 
2054
2054
  ### `ContactEnrichmentData`
2055
2055
 
2056
2056
  ```typescript
2057
- /**
2058
- * Enrichment data collected for a contact from various sources.
2059
- */
2060
- export interface ContactEnrichmentData {
2061
- linkedin?: {
2062
- summary?: string
2063
- pastExperience?: string
2064
- education?: string
2065
- activity?: Array<{ date?: string; content?: string }>
2066
- }
2057
+ /**
2058
+ * Enrichment data collected for a contact from various sources.
2059
+ */
2060
+ export interface ContactEnrichmentData {
2061
+ linkedin?: {
2062
+ summary?: string
2063
+ pastExperience?: string
2064
+ education?: string
2065
+ activity?: Array<{ date?: string; content?: string }>
2066
+ }
2067
2067
  }
2068
2068
  ```
2069
2069
 
2070
2070
  ### `AcqList`
2071
2071
 
2072
2072
  ```typescript
2073
- export interface AcqList {
2074
- id: string
2075
- organizationId: string
2076
- name: string
2077
- description: string | null
2078
- batchIds: string[]
2079
- instantlyCampaignId: string | null
2080
- status: ListStatus
2081
- scrapingConfig: ScrapingConfig
2082
- icp: IcpRubric
2083
- pipelineConfig: PipelineConfig
2084
- metadata: AcqListMetadata
2085
- launchedAt: Date | null
2086
- completedAt: Date | null
2087
- createdAt: Date
2073
+ export interface AcqList {
2074
+ id: string
2075
+ organizationId: string
2076
+ name: string
2077
+ description: string | null
2078
+ batchIds: string[]
2079
+ instantlyCampaignId: string | null
2080
+ status: ListStatus
2081
+ scrapingConfig: ScrapingConfig
2082
+ icp: IcpRubric
2083
+ pipelineConfig: PipelineConfig
2084
+ metadata: AcqListMetadata
2085
+ launchedAt: Date | null
2086
+ completedAt: Date | null
2087
+ createdAt: Date
2088
2088
  }
2089
2089
  ```
2090
2090
 
2091
2091
  ### `AcqCompany`
2092
2092
 
2093
2093
  ```typescript
2094
- /**
2095
- * Company record in the acquisition database.
2096
- * Contains enriched company data from various sources.
2097
- * Transformed from AcqCompanyRow with camelCase properties.
2098
- */
2099
- export interface AcqCompany {
2100
- id: string
2101
- organizationId: string
2102
- name: string
2103
- domain: string | null
2104
- linkedinUrl: string | null
2105
- website: string | null
2106
- numEmployees: number | null
2107
- foundedYear: number | null
2108
- locationCity: string | null
2109
- locationState: string | null
2110
- category: string | null
2111
- categoryPain: string | null
2112
- segment: string | null
2113
- processingState: CompanyProcessingState | null
2114
- /** @deprecated Use `processingState`. This legacy DB column has been removed; responses return null. */
2115
- pipelineStatus?: LegacyPipelineStatus | null
2116
- enrichmentData: CompanyEnrichmentData | null
2117
- source: string | null
2118
- batchId: string | null
2119
- status: 'active' | 'invalid'
2120
- verticalResearch: string | null
2121
- /** Track A: flat qualification score (null until a scoring rubric is defined). Added by W1 migration. */
2122
- qualificationScore: number | null
2123
- /** Track A: flat qualification signals jsonb preserving the result payload shape. Added by W1 migration. */
2124
- qualificationSignals: Record<string, unknown> | null
2125
- /** Track A: key identifying the rubric used for qualification. Added by W1 migration. */
2126
- qualificationRubricKey: string | null
2127
- createdAt: Date
2128
- updatedAt: Date
2094
+ /**
2095
+ * Company record in the acquisition database.
2096
+ * Contains enriched company data from various sources.
2097
+ * Transformed from AcqCompanyRow with camelCase properties.
2098
+ */
2099
+ export interface AcqCompany {
2100
+ id: string
2101
+ organizationId: string
2102
+ name: string
2103
+ domain: string | null
2104
+ linkedinUrl: string | null
2105
+ website: string | null
2106
+ numEmployees: number | null
2107
+ foundedYear: number | null
2108
+ locationCity: string | null
2109
+ locationState: string | null
2110
+ category: string | null
2111
+ categoryPain: string | null
2112
+ segment: string | null
2113
+ processingState: CompanyProcessingState | null
2114
+ /** @deprecated Use `processingState`. This legacy DB column has been removed; responses return null. */
2115
+ pipelineStatus?: LegacyPipelineStatus | null
2116
+ enrichmentData: CompanyEnrichmentData | null
2117
+ source: string | null
2118
+ batchId: string | null
2119
+ status: 'active' | 'invalid'
2120
+ verticalResearch: string | null
2121
+ /** Track A: flat qualification score (null until a scoring rubric is defined). Added by W1 migration. */
2122
+ qualificationScore: number | null
2123
+ /** Track A: flat qualification signals jsonb preserving the result payload shape. Added by W1 migration. */
2124
+ qualificationSignals: Record<string, unknown> | null
2125
+ /** Track A: key identifying the rubric used for qualification. Added by W1 migration. */
2126
+ qualificationRubricKey: string | null
2127
+ createdAt: Date
2128
+ updatedAt: Date
2129
2129
  }
2130
2130
  ```
2131
2131
 
2132
2132
  ### `AcqContact`
2133
2133
 
2134
2134
  ```typescript
2135
- /**
2136
- * Contact record in the acquisition database.
2137
- * Contains enriched contact data and personalization content.
2138
- * Transformed from AcqContactRow with camelCase properties.
2139
- */
2140
- export interface AcqContact {
2141
- id: string
2142
- organizationId: string
2143
- companyId: string | null
2144
- email: string
2145
- emailValid: 'VALID' | 'INVALID' | 'RISKY' | 'UNKNOWN' | null
2146
- firstName: string | null
2147
- lastName: string | null
2148
- linkedinUrl: string | null
2149
- title: string | null
2150
- headline: string | null
2151
- filterReason: string | null
2152
- openingLine: string | null
2153
- source: string | null
2154
- sourceId: string | null
2155
- processingState: ContactProcessingState | null
2156
- /** @deprecated Use `processingState`. This legacy DB column has been removed; responses return null. */
2157
- pipelineStatus?: LegacyPipelineStatus | null
2158
- enrichmentData: ContactEnrichmentData | null
2159
- /** Attio Person record ID - set when contact responds and is added to CRM */
2160
- attioPersonId: string | null
2161
- batchId: string | null
2162
- status: 'active' | 'invalid'
2163
- createdAt: Date
2164
- updatedAt: Date
2135
+ /**
2136
+ * Contact record in the acquisition database.
2137
+ * Contains enriched contact data and personalization content.
2138
+ * Transformed from AcqContactRow with camelCase properties.
2139
+ */
2140
+ export interface AcqContact {
2141
+ id: string
2142
+ organizationId: string
2143
+ companyId: string | null
2144
+ email: string
2145
+ emailValid: 'VALID' | 'INVALID' | 'RISKY' | 'UNKNOWN' | null
2146
+ firstName: string | null
2147
+ lastName: string | null
2148
+ linkedinUrl: string | null
2149
+ title: string | null
2150
+ headline: string | null
2151
+ filterReason: string | null
2152
+ openingLine: string | null
2153
+ source: string | null
2154
+ sourceId: string | null
2155
+ processingState: ContactProcessingState | null
2156
+ /** @deprecated Use `processingState`. This legacy DB column has been removed; responses return null. */
2157
+ pipelineStatus?: LegacyPipelineStatus | null
2158
+ enrichmentData: ContactEnrichmentData | null
2159
+ /** Attio Person record ID - set when contact responds and is added to CRM */
2160
+ attioPersonId: string | null
2161
+ batchId: string | null
2162
+ status: 'active' | 'invalid'
2163
+ createdAt: Date
2164
+ updatedAt: Date
2165
2165
  }
2166
2166
  ```
2167
2167
 
2168
2168
  ### `ListTelemetry`
2169
2169
 
2170
2170
  ```typescript
2171
- /**
2172
- * Live-scan aggregate telemetry for a single list, computed on demand from
2173
- * the list junction tables and current contact deliverability state.
2174
- * `stageCounts` are attempted counts from list-row processing_state.
2175
- */
2176
- export interface ListTelemetry {
2177
- listId: string
2178
- totalCompanies: number
2179
- totalContacts: number
2180
- stageCounts: {
2181
- populated: number
2182
- extracted: number
2183
- qualified: number
2184
- discovered: number
2185
- verified: number
2186
- personalized: number
2187
- uploaded: number
2188
- }
2189
- deliverability: {
2190
- valid: number
2191
- risky: number
2192
- invalid: number
2193
- unknown: number
2194
- bounced: number
2195
- }
2196
- /** Reserved -- active workflow IDs associated with this list. */
2197
- activeWorkflows?: string[]
2171
+ /**
2172
+ * Live-scan aggregate telemetry for a single list, computed on demand from
2173
+ * the list junction tables and current contact deliverability state.
2174
+ * `stageCounts` are attempted counts from list-row processing_state.
2175
+ */
2176
+ export interface ListTelemetry {
2177
+ listId: string
2178
+ totalCompanies: number
2179
+ totalContacts: number
2180
+ stageCounts: {
2181
+ populated: number
2182
+ extracted: number
2183
+ qualified: number
2184
+ discovered: number
2185
+ verified: number
2186
+ personalized: number
2187
+ uploaded: number
2188
+ }
2189
+ deliverability: {
2190
+ valid: number
2191
+ risky: number
2192
+ invalid: number
2193
+ unknown: number
2194
+ bounced: number
2195
+ }
2196
+ /** Reserved -- active workflow IDs associated with this list. */
2197
+ activeWorkflows?: string[]
2198
2198
  }
2199
2199
  ```
2200
2200
 
@@ -2918,6 +2918,7 @@ export const AcqListSchemas = {
2918
2918
  ScrapingConfig: ScrapingConfigSchema,
2919
2919
  IcpRubric: IcpRubricSchema,
2920
2920
  PipelineConfig: PipelineConfigSchema,
2921
+ DataMode: DataModeSchema,
2921
2922
  PipelineStage: PipelineStageSchema,
2922
2923
  BuildPlanSnapshot: BuildPlanSnapshotSchema,
2923
2924
  BuildPlanSnapshotStep: BuildPlanSnapshotStepSchema,
@@ -3434,26 +3435,28 @@ export interface UpdateListConfigParams {
3434
3435
  ### `UpdateCompanyStageParams`
3435
3436
 
3436
3437
  ```typescript
3437
- export interface UpdateCompanyStageParams {
3438
- organizationId: string
3439
- listId: string
3440
- companyId: string
3441
- stage: string
3442
- status?: ProcessingStageStatus
3443
- executionId?: string
3438
+ export interface UpdateCompanyStageParams {
3439
+ organizationId: string
3440
+ listId: string
3441
+ companyId: string
3442
+ stage: string
3443
+ status?: ProcessingStageStatus
3444
+ data?: unknown
3445
+ executionId?: string
3444
3446
  }
3445
3447
  ```
3446
3448
 
3447
3449
  ### `UpdateContactStageParams`
3448
3450
 
3449
3451
  ```typescript
3450
- export interface UpdateContactStageParams {
3451
- organizationId: string
3452
- listId: string
3453
- contactId: string
3454
- stage: string
3455
- status?: ProcessingStageStatus
3456
- executionId?: string
3452
+ export interface UpdateContactStageParams {
3453
+ organizationId: string
3454
+ listId: string
3455
+ contactId: string
3456
+ stage: string
3457
+ status?: ProcessingStageStatus
3458
+ data?: unknown
3459
+ executionId?: string
3457
3460
  }
3458
3461
  ```
3459
3462
 
@@ -3508,13 +3511,14 @@ export interface RecordListExecutionParams {
3508
3511
  ### `ListExecutionSummary`
3509
3512
 
3510
3513
  ```typescript
3511
- export interface ListExecutionSummary {
3512
- executionId: string
3513
- resourceId: string
3514
- status: string
3515
- createdAt: string
3516
- completedAt: string | null
3517
- durationMs: number | null
3514
+ export interface ListExecutionSummary {
3515
+ executionId: string
3516
+ resourceId: string
3517
+ status: string
3518
+ createdAt: string
3519
+ completedAt: string | null
3520
+ durationMs: number | null
3521
+ input?: unknown
3518
3522
  }
3519
3523
  ```
3520
3524
 
@@ -3593,6 +3597,14 @@ export type LeadToolMap = {
3593
3597
  params: Omit<UpdateContactStageParams, 'organizationId'>
3594
3598
  result: void
3595
3599
  }
3600
+ clearCompanyStages: {
3601
+ params: Omit<ClearCompanyStagesParams, 'organizationId'>
3602
+ result: void
3603
+ }
3604
+ clearContactStages: {
3605
+ params: Omit<ClearContactStagesParams, 'organizationId'>
3606
+ result: void
3607
+ }
3596
3608
  // Company operations
3597
3609
  createCompany: { params: Omit<CreateCompanyParams, 'organizationId'>; result: AcqCompany }
3598
3610
  upsertCompany: { params: Omit<UpsertCompanyParams, 'organizationId'>; result: AcqCompany }
@@ -3717,7 +3729,11 @@ export type LeadToolMap = {
3717
3729
  export type ListToolMap = {
3718
3730
  getConfig: {
3719
3731
  params: { listId: string }
3720
- result: { scrapingConfig: ScrapingConfig; icp: IcpRubric; pipelineConfig: PipelineConfig }
3732
+ result: {
3733
+ scrapingConfig: ScrapingConfig
3734
+ icp: IcpRubric
3735
+ pipelineConfig: PipelineConfig & { dataMode: 'mock' | 'live' }
3736
+ }
3721
3737
  }
3722
3738
  recordExecution: {
3723
3739
  params: Omit<RecordListExecutionParams, 'organizationId'>
@@ -3731,6 +3747,14 @@ export type ListToolMap = {
3731
3747
  params: Omit<UpdateContactStageParams, 'organizationId'>
3732
3748
  result: void
3733
3749
  }
3750
+ clearCompanyStages: {
3751
+ params: Omit<ClearCompanyStagesParams, 'organizationId'>
3752
+ result: void
3753
+ }
3754
+ clearContactStages: {
3755
+ params: Omit<ClearContactStagesParams, 'organizationId'>
3756
+ result: void
3757
+ }
3734
3758
  listPendingCompanyIds: {
3735
3759
  params: Omit<ListPendingCompanyIdsParams, 'organizationId'>
3736
3760
  result: string[]