@elevasis/sdk 1.23.0 → 1.25.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 (55) hide show
  1. package/dist/cli.cjs +5927 -6985
  2. package/dist/index.d.ts +4893 -4759
  3. package/dist/index.js +1444 -3870
  4. package/dist/node/index.d.ts +3059 -2
  5. package/dist/node/index.js +163 -1
  6. package/dist/test-utils/index.d.ts +4413 -4439
  7. package/dist/test-utils/index.js +1766 -4753
  8. package/dist/types/worker/index.d.ts +5 -2
  9. package/dist/types/worker/platform.d.ts +2 -2
  10. package/dist/types/worker/utils.d.ts +9 -0
  11. package/dist/worker/index.js +427 -3708
  12. package/package.json +5 -4
  13. package/reference/_navigation.md +1 -0
  14. package/reference/claude-config/rules/active-change-index.md +11 -80
  15. package/reference/claude-config/rules/agent-start-here.md +11 -277
  16. package/reference/claude-config/rules/deployment.md +11 -57
  17. package/reference/claude-config/rules/error-handling.md +11 -56
  18. package/reference/claude-config/rules/execution.md +11 -40
  19. package/reference/claude-config/rules/frontend.md +11 -43
  20. package/reference/claude-config/rules/observability.md +11 -31
  21. package/reference/claude-config/rules/operations.md +11 -80
  22. package/reference/claude-config/rules/organization-model.md +5 -110
  23. package/reference/claude-config/rules/organization-os.md +7 -111
  24. package/reference/claude-config/rules/package-taxonomy.md +11 -33
  25. package/reference/claude-config/rules/platform.md +11 -42
  26. package/reference/claude-config/rules/shared-types.md +10 -48
  27. package/reference/claude-config/rules/task-tracking.md +11 -47
  28. package/reference/claude-config/rules/ui.md +11 -200
  29. package/reference/claude-config/rules/vibe.md +5 -229
  30. package/reference/claude-config/sync-notes/2026-05-04-knowledge-bundle.md +83 -83
  31. package/reference/claude-config/sync-notes/2026-05-15-om-skill-rename-and-write-family.md +2 -2
  32. package/reference/claude-config/sync-notes/2026-05-17-sdk-boundary-consolidation.md +33 -0
  33. package/reference/cli.mdx +1107 -808
  34. package/reference/rules/active-change-index.md +83 -0
  35. package/reference/rules/agent-start-here.md +280 -0
  36. package/reference/rules/deployment.md +60 -0
  37. package/reference/rules/error-handling.md +59 -0
  38. package/reference/rules/execution.md +43 -0
  39. package/reference/rules/frontend.md +46 -0
  40. package/reference/rules/observability.md +34 -0
  41. package/reference/rules/operations.md +85 -0
  42. package/reference/rules/organization-model.md +119 -0
  43. package/reference/rules/organization-os.md +118 -0
  44. package/reference/rules/package-taxonomy.md +36 -0
  45. package/reference/rules/platform.md +45 -0
  46. package/reference/rules/shared-types.md +52 -0
  47. package/reference/rules/task-tracking.md +50 -0
  48. package/reference/rules/ui.md +203 -0
  49. package/reference/rules/vibe.md +238 -0
  50. package/reference/scaffold/core/organization-graph.mdx +4 -5
  51. package/reference/scaffold/core/organization-model.mdx +1 -1
  52. package/reference/scaffold/recipes/customize-crm-actions.md +45 -46
  53. package/reference/scaffold/recipes/extend-crm.md +253 -255
  54. package/reference/scaffold/recipes/index.md +43 -44
  55. package/reference/scaffold/reference/contracts.md +990 -1065
@@ -309,7 +309,7 @@ export type OrganizationModelSystemLifecycle = z.infer<typeof SystemLifecycleSch
309
309
  ### `OrganizationModelSystemStatus`
310
310
 
311
311
  ```typescript
312
- /** @deprecated Use OrganizationModelSystemLifecycle. Accepted for one publish cycle. */
312
+ /** @deprecated Use OrganizationModelSystemLifecycle. Accepted for one publish cycle. */
313
313
  export type OrganizationModelSystemStatus = z.infer<typeof SystemStatusSchema>
314
314
  ```
315
315
 
@@ -379,6 +379,18 @@ export type OrganizationModelResourceGovernanceStatus = z.infer<typeof ResourceG
379
379
  export type OrganizationModelResourceOntologyBinding = z.infer<typeof ResourceOntologyBindingSchema>
380
380
  ```
381
381
 
382
+ ### `OrganizationModelContractRef`
383
+
384
+ ```typescript
385
+ export type OrganizationModelContractRef = z.infer<typeof ContractRefSchema>
386
+ ```
387
+
388
+ ### `OrganizationModelResourceOntologyBindingContract`
389
+
390
+ ```typescript
391
+ export type OrganizationModelResourceOntologyBindingContract = ResourceOntologyBindingContract
392
+ ```
393
+
382
394
  ### `OrganizationModelAgentKind`
383
395
 
384
396
  ```typescript
@@ -628,7 +640,7 @@ export type OrganizationModelBuiltinIconToken = z.infer<typeof OrganizationModel
628
640
  ### `DeepPartial`
629
641
 
630
642
  ```typescript
631
- export type DeepPartial<T> =
643
+ export type DeepPartial<T> =
632
644
  T extends Array<infer U> ? Array<DeepPartial<U>> : T extends object ? { [K in keyof T]?: DeepPartial<T[K]> } : T
633
645
  ```
634
646
 
@@ -1569,54 +1581,24 @@ export type CrmPriorityBucketKey = 'needs_response' | 'follow_up_due' | 'waiting
1569
1581
  ### `CrmPriorityBucketDefinition`
1570
1582
 
1571
1583
  ```typescript
1572
- export interface CrmPriorityBucketDefinition {
1573
- bucketKey: CrmPriorityBucketKey
1574
- label: string
1575
- /** Lower ranks sort first in deal lists and pipeline columns. */
1576
- rank: number
1577
- /** UI color token. Consumers may map this to their design system. */
1578
- color: string
1584
+ export interface CrmPriorityBucketDefinition {
1585
+ bucketKey: CrmPriorityBucketKey
1586
+ label: string
1587
+ /** Lower ranks sort first in deal lists and pipeline columns. */
1588
+ rank: number
1589
+ /** UI color token. Consumers may map this to their design system. */
1590
+ color: string
1579
1591
  }
1580
1592
  ```
1581
1593
 
1582
1594
  ### `CrmPriorityRuleConfig`
1583
1595
 
1584
1596
  ```typescript
1585
- export interface CrmPriorityRuleConfig {
1586
- buckets: CrmPriorityBucketDefinition[]
1587
- closedStageKeys: string[]
1588
- followUpAfterDaysByStateKey: Record<string, number>
1589
- staleAfterDays: number
1590
- }
1591
- ```
1592
-
1593
- ### `CRM_PRIORITY_BUCKETS`
1594
-
1595
- ```typescript
1596
- export const CRM_PRIORITY_BUCKETS: CrmPriorityBucketDefinition[] = [
1597
- { bucketKey: 'needs_response', label: 'Needs Response', rank: 10, color: 'red' },
1598
- { bucketKey: 'follow_up_due', label: 'Follow-up Due', rank: 20, color: 'orange' },
1599
- { bucketKey: 'waiting', label: 'Waiting', rank: 30, color: 'blue' },
1600
- { bucketKey: 'stale', label: 'Stale', rank: 40, color: 'gray' },
1601
- { bucketKey: 'closed_low', label: 'Closed', rank: 50, color: 'dark' }
1602
- ]
1603
- ```
1604
-
1605
- ### `DEFAULT_CRM_PRIORITY_RULE_CONFIG`
1606
-
1607
- ```typescript
1608
- export const DEFAULT_CRM_PRIORITY_RULE_CONFIG: CrmPriorityRuleConfig = {
1609
- buckets: CRM_PRIORITY_BUCKETS,
1610
- closedStageKeys: ['closed_won', 'closed_lost'],
1611
- followUpAfterDaysByStateKey: {
1612
- discovery_link_sent: 3,
1613
- discovery_nudging: 2,
1614
- reply_sent: 3,
1615
- followup_1_sent: 3,
1616
- followup_2_sent: 5,
1617
- followup_3_sent: 7
1618
- },
1619
- staleAfterDays: 14
1597
+ export interface CrmPriorityRuleConfig {
1598
+ buckets: CrmPriorityBucketDefinition[]
1599
+ closedStageKeys: string[]
1600
+ followUpAfterDaysByStateKey: Record<string, number>
1601
+ staleAfterDays: number
1620
1602
  }
1621
1603
  ```
1622
1604
 
@@ -1635,242 +1617,242 @@ export const AcqDealTaskKindSchema = z.enum(['call', 'email', 'meeting', 'other'
1635
1617
  ### `DealIdParamsSchema`
1636
1618
 
1637
1619
  ```typescript
1638
- export const DealIdParamsSchema = z.object({
1639
- dealId: UuidSchema
1620
+ export const DealIdParamsSchema = z.object({
1621
+ dealId: UuidSchema
1640
1622
  })
1641
1623
  ```
1642
1624
 
1643
1625
  ### `DealTaskIdParamsSchema`
1644
1626
 
1645
1627
  ```typescript
1646
- export const DealTaskIdParamsSchema = z.object({
1647
- dealId: UuidSchema,
1648
- taskId: UuidSchema
1628
+ export const DealTaskIdParamsSchema = z.object({
1629
+ dealId: UuidSchema,
1630
+ taskId: UuidSchema
1649
1631
  })
1650
1632
  ```
1651
1633
 
1652
1634
  ### `ListDealsQuerySchema`
1653
1635
 
1654
1636
  ```typescript
1655
- export const ListDealsQuerySchema = z
1656
- .object({
1657
- stage: DealStageSchema.optional(),
1658
- list: UuidSchema.optional(),
1659
- batch: z.string().trim().min(1).max(255).optional(),
1660
- staleSince: z.string().datetime().optional(),
1661
- search: z.string().optional(),
1662
- limit: z.coerce.number().int().positive().default(50),
1663
- offset: z.coerce.number().int().min(0).default(0)
1664
- })
1637
+ export const ListDealsQuerySchema = z
1638
+ .object({
1639
+ stage: DealStageSchema.optional(),
1640
+ list: UuidSchema.optional(),
1641
+ batch: z.string().trim().min(1).max(255).optional(),
1642
+ staleSince: z.string().datetime().optional(),
1643
+ search: z.string().optional(),
1644
+ limit: z.coerce.number().int().positive().default(50),
1645
+ offset: z.coerce.number().int().min(0).default(0)
1646
+ })
1665
1647
  .strict()
1666
1648
  ```
1667
1649
 
1668
1650
  ### `DealLookupQuerySchema`
1669
1651
 
1670
1652
  ```typescript
1671
- export const DealLookupQuerySchema = z
1672
- .object({
1673
- search: z.string().trim().min(1).max(200).optional(),
1674
- limit: z.coerce.number().int().min(1).max(25).default(10)
1675
- })
1653
+ export const DealLookupQuerySchema = z
1654
+ .object({
1655
+ search: z.string().trim().min(1).max(200).optional(),
1656
+ limit: z.coerce.number().int().min(1).max(25).default(10)
1657
+ })
1676
1658
  .strict()
1677
1659
  ```
1678
1660
 
1679
1661
  ### `ListDealTasksDueQuerySchema`
1680
1662
 
1681
1663
  ```typescript
1682
- export const ListDealTasksDueQuerySchema = z
1683
- .object({
1684
- window: z.enum(['overdue', 'today', 'today_and_overdue', 'upcoming']).optional(),
1685
- assigneeUserId: UuidSchema.optional()
1686
- })
1664
+ export const ListDealTasksDueQuerySchema = z
1665
+ .object({
1666
+ window: z.enum(['overdue', 'today', 'today_and_overdue', 'upcoming']).optional(),
1667
+ assigneeUserId: UuidSchema.optional()
1668
+ })
1687
1669
  .strict()
1688
1670
  ```
1689
1671
 
1690
1672
  ### `CreateDealNoteRequestSchema`
1691
1673
 
1692
1674
  ```typescript
1693
- export const CreateDealNoteRequestSchema = z
1694
- .object({
1695
- body: z.string().trim().min(1).max(10000)
1696
- })
1675
+ export const CreateDealNoteRequestSchema = z
1676
+ .object({
1677
+ body: z.string().trim().min(1).max(10000)
1678
+ })
1697
1679
  .strict()
1698
1680
  ```
1699
1681
 
1700
1682
  ### `CreateDealTaskRequestSchema`
1701
1683
 
1702
1684
  ```typescript
1703
- export const CreateDealTaskRequestSchema = z
1704
- .object({
1705
- title: z.string().trim().min(1).max(255),
1706
- description: z.string().nullable().optional(),
1707
- kind: AcqDealTaskKindSchema.optional(),
1708
- dueAt: z.string().datetime().nullable().optional(),
1709
- assigneeUserId: UuidSchema.nullable().optional()
1710
- })
1685
+ export const CreateDealTaskRequestSchema = z
1686
+ .object({
1687
+ title: z.string().trim().min(1).max(255),
1688
+ description: z.string().nullable().optional(),
1689
+ kind: AcqDealTaskKindSchema.optional(),
1690
+ dueAt: z.string().datetime().nullable().optional(),
1691
+ assigneeUserId: UuidSchema.nullable().optional()
1692
+ })
1711
1693
  .strict()
1712
1694
  ```
1713
1695
 
1714
1696
  ### `TransitionItemRequestSchema`
1715
1697
 
1716
1698
  ```typescript
1717
- export const TransitionItemRequestSchema = z
1718
- .object({
1719
- pipelineKey: z.string().min(1),
1720
- stageKey: z.string().min(1),
1721
- stateKey: z.string().min(1).nullable().optional(),
1722
- reason: z.string().optional(),
1723
- expectedUpdatedAt: z.string().datetime().optional()
1724
- })
1699
+ export const TransitionItemRequestSchema = z
1700
+ .object({
1701
+ pipelineKey: z.string().min(1),
1702
+ stageKey: z.string().min(1),
1703
+ stateKey: z.string().min(1).nullable().optional(),
1704
+ reason: z.string().optional(),
1705
+ expectedUpdatedAt: z.string().datetime().optional()
1706
+ })
1725
1707
  .strict()
1726
1708
  ```
1727
1709
 
1728
1710
  ### `ExecuteActionParamsSchema`
1729
1711
 
1730
1712
  ```typescript
1731
- export const ExecuteActionParamsSchema = z
1732
- .object({
1733
- dealId: UuidSchema,
1734
- actionKey: NonEmptyStringSchema
1735
- })
1713
+ export const ExecuteActionParamsSchema = z
1714
+ .object({
1715
+ dealId: UuidSchema,
1716
+ actionKey: NonEmptyStringSchema
1717
+ })
1736
1718
  .strict()
1737
1719
  ```
1738
1720
 
1739
1721
  ### `ExecuteActionRequestSchema`
1740
1722
 
1741
1723
  ```typescript
1742
- export const ExecuteActionRequestSchema = z
1743
- .object({
1744
- payload: z.record(z.string(), z.unknown()).optional()
1745
- })
1724
+ export const ExecuteActionRequestSchema = z
1725
+ .object({
1726
+ payload: z.record(z.string(), z.unknown()).optional()
1727
+ })
1746
1728
  .strict()
1747
1729
  ```
1748
1730
 
1749
1731
  ### `DealContactSummarySchema`
1750
1732
 
1751
1733
  ```typescript
1752
- /**
1753
- * Contact summary nested inside DealListItem / DealDetailResponse.
1754
- * Matches the joined shape returned by useDeals / useDealDetail Supabase queries.
1755
- */
1756
- export const DealContactSummarySchema = z.object({
1757
- id: z.string(),
1758
- first_name: z.string().nullable(),
1759
- last_name: z.string().nullable(),
1760
- email: z.string(),
1761
- title: z.string().nullable(),
1762
- headline: z.string().nullable(),
1763
- linkedin_url: z.string().nullable(),
1764
- processing_state: ProcessingStateSchema.nullable(),
1765
- enrichment_data: z.record(z.string(), z.unknown()).nullable(),
1766
- company: z
1767
- .object({
1768
- id: z.string(),
1769
- name: z.string(),
1770
- domain: z.string().nullable(),
1771
- website: z.string().nullable(),
1772
- linkedin_url: z.string().nullable(),
1773
- segment: z.string().nullable(),
1774
- category: z.string().nullable(),
1775
- num_employees: z.number().nullable()
1776
- })
1777
- .nullable()
1734
+ /**
1735
+ * Contact summary nested inside DealListItem / DealDetailResponse.
1736
+ * Matches the joined shape returned by useDeals / useDealDetail Supabase queries.
1737
+ */
1738
+ export const DealContactSummarySchema = z.object({
1739
+ id: z.string(),
1740
+ first_name: z.string().nullable(),
1741
+ last_name: z.string().nullable(),
1742
+ email: z.string(),
1743
+ title: z.string().nullable(),
1744
+ headline: z.string().nullable(),
1745
+ linkedin_url: z.string().nullable(),
1746
+ processing_state: ProcessingStateSchema.nullable(),
1747
+ enrichment_data: z.record(z.string(), z.unknown()).nullable(),
1748
+ company: z
1749
+ .object({
1750
+ id: z.string(),
1751
+ name: z.string(),
1752
+ domain: z.string().nullable(),
1753
+ website: z.string().nullable(),
1754
+ linkedin_url: z.string().nullable(),
1755
+ segment: z.string().nullable(),
1756
+ category: z.string().nullable(),
1757
+ num_employees: z.number().nullable()
1758
+ })
1759
+ .nullable()
1778
1760
  })
1779
1761
  ```
1780
1762
 
1781
1763
  ### `DealPrioritySchema`
1782
1764
 
1783
1765
  ```typescript
1784
- export const DealPrioritySchema = z.object({
1785
- bucketKey: z.enum(['needs_response', 'follow_up_due', 'waiting', 'stale', 'closed_low']),
1786
- rank: z.number().int(),
1787
- label: z.string(),
1788
- color: z.string(),
1789
- reason: z.string(),
1790
- latestActivityAt: z.string().nullable(),
1791
- nextActionAt: z.string().nullable()
1766
+ export const DealPrioritySchema = z.object({
1767
+ bucketKey: z.enum(['needs_response', 'follow_up_due', 'waiting', 'stale', 'closed_low']),
1768
+ rank: z.number().int(),
1769
+ label: z.string(),
1770
+ color: z.string(),
1771
+ reason: z.string(),
1772
+ latestActivityAt: z.string().nullable(),
1773
+ nextActionAt: z.string().nullable()
1792
1774
  })
1793
1775
  ```
1794
1776
 
1795
1777
  ### `DealListItemSchema`
1796
1778
 
1797
1779
  ```typescript
1798
- /**
1799
- * Deal list item with joined contact (and company via contact).
1800
- * Matches DealListItem from @repo/core types.
1801
- */
1802
- export const DealListItemSchema = z.object({
1803
- // acq_deals columns
1804
- id: z.string(),
1805
- organization_id: z.string(),
1806
- client_id: z.string().nullable().optional(),
1807
- contact_id: z.string().nullable(),
1808
- contact_email: z.string(),
1809
- pipeline_key: z.string(),
1810
- stage_key: z.string().nullable(),
1811
- state_key: z.string().nullable(),
1812
- activity_log: z.unknown(),
1813
- discovery_data: z.unknown().nullable(),
1814
- discovery_submitted_at: z.string().nullable(),
1815
- discovery_submitted_by: z.string().nullable(),
1816
- proposal_data: z.unknown().nullable(),
1817
- proposal_sent_at: z.string().nullable(),
1818
- proposal_pdf_url: z.string().nullable(),
1819
- signature_envelope_id: z.string().nullable(),
1820
- source_list_id: z.string().nullable(),
1821
- source_type: z.string().nullable(),
1822
- initial_fee: z.number().nullable(),
1823
- monthly_fee: z.number().nullable(),
1824
- closed_lost_at: z.string().nullable(),
1825
- closed_lost_reason: z.string().nullable(),
1826
- created_at: z.string(),
1827
- updated_at: z.string(),
1828
- priority: DealPrioritySchema,
1829
- ownership: z.enum(['us', 'them']).nullable(),
1830
- nextAction: z.string().nullable(),
1831
- // joined relation
1832
- contact: DealContactSummarySchema.nullable()
1780
+ /**
1781
+ * Deal list item with joined contact (and company via contact).
1782
+ * Matches DealListItem from @repo/core types.
1783
+ */
1784
+ export const DealListItemSchema = z.object({
1785
+ // acq_deals columns
1786
+ id: z.string(),
1787
+ organization_id: z.string(),
1788
+ client_id: z.string().nullable().optional(),
1789
+ contact_id: z.string().nullable(),
1790
+ contact_email: z.string(),
1791
+ pipeline_key: z.string(),
1792
+ stage_key: z.string().nullable(),
1793
+ state_key: z.string().nullable(),
1794
+ activity_log: z.unknown(),
1795
+ discovery_data: z.unknown().nullable(),
1796
+ discovery_submitted_at: z.string().nullable(),
1797
+ discovery_submitted_by: z.string().nullable(),
1798
+ proposal_data: z.unknown().nullable(),
1799
+ proposal_sent_at: z.string().nullable(),
1800
+ proposal_pdf_url: z.string().nullable(),
1801
+ signature_envelope_id: z.string().nullable(),
1802
+ source_list_id: z.string().nullable(),
1803
+ source_type: z.string().nullable(),
1804
+ initial_fee: z.number().nullable(),
1805
+ monthly_fee: z.number().nullable(),
1806
+ closed_lost_at: z.string().nullable(),
1807
+ closed_lost_reason: z.string().nullable(),
1808
+ created_at: z.string(),
1809
+ updated_at: z.string(),
1810
+ priority: DealPrioritySchema,
1811
+ ownership: z.enum(['us', 'them']).nullable(),
1812
+ nextAction: z.string().nullable(),
1813
+ // joined relation
1814
+ contact: DealContactSummarySchema.nullable()
1833
1815
  })
1834
1816
  ```
1835
1817
 
1836
1818
  ### `DealListResponseSchema`
1837
1819
 
1838
1820
  ```typescript
1839
- export const DealListResponseSchema = z.object({
1840
- data: z.array(DealListItemSchema),
1841
- total: z.number().int(),
1842
- limit: z.number().int(),
1843
- offset: z.number().int()
1821
+ export const DealListResponseSchema = z.object({
1822
+ data: z.array(DealListItemSchema),
1823
+ total: z.number().int(),
1824
+ limit: z.number().int(),
1825
+ offset: z.number().int()
1844
1826
  })
1845
1827
  ```
1846
1828
 
1847
1829
  ### `DealDetailResponseSchema`
1848
1830
 
1849
1831
  ```typescript
1850
- /**
1851
- * Deal detail shape — currently the same as a list item (full joined record).
1852
- * Additive fields keep existing DealListItem callers compatible.
1853
- */
1854
- export const DealDetailResponseSchema = DealListItemSchema.extend({
1855
- conversation: DealConversationSchema,
1856
- lineage: DealLineageSchema.optional()
1832
+ /**
1833
+ * Deal detail shape — currently the same as a list item (full joined record).
1834
+ * Additive fields keep existing DealListItem callers compatible.
1835
+ */
1836
+ export const DealDetailResponseSchema = DealListItemSchema.extend({
1837
+ conversation: DealConversationSchema,
1838
+ lineage: DealLineageSchema.optional()
1857
1839
  })
1858
1840
  ```
1859
1841
 
1860
1842
  ### `DealNoteResponseSchema`
1861
1843
 
1862
1844
  ```typescript
1863
- /**
1864
- * Single acq_deal_notes row (camelCase API representation).
1865
- */
1866
- export const DealNoteResponseSchema = z.object({
1867
- id: z.string(),
1868
- dealId: z.string(),
1869
- organizationId: z.string(),
1870
- authorUserId: z.string().nullable(),
1871
- body: z.string(),
1872
- createdAt: z.string(),
1873
- updatedAt: z.string()
1845
+ /**
1846
+ * Single acq_deal_notes row (camelCase API representation).
1847
+ */
1848
+ export const DealNoteResponseSchema = z.object({
1849
+ id: z.string(),
1850
+ dealId: z.string(),
1851
+ organizationId: z.string(),
1852
+ authorUserId: z.string().nullable(),
1853
+ body: z.string(),
1854
+ createdAt: z.string(),
1855
+ updatedAt: z.string()
1874
1856
  })
1875
1857
  ```
1876
1858
 
@@ -1883,24 +1865,24 @@ export const DealNoteListResponseSchema = z.array(DealNoteResponseSchema)
1883
1865
  ### `DealTaskResponseSchema`
1884
1866
 
1885
1867
  ```typescript
1886
- /**
1887
- * Single acq_deal_tasks row (camelCase API representation).
1888
- * Matches AcqDealTask domain type from types.ts.
1889
- */
1890
- export const DealTaskResponseSchema = z.object({
1891
- id: z.string(),
1892
- organizationId: z.string(),
1893
- dealId: z.string(),
1894
- title: z.string(),
1895
- description: z.string().nullable(),
1896
- kind: AcqDealTaskKindSchema,
1897
- dueAt: z.string().nullable(),
1898
- assigneeUserId: z.string().nullable(),
1899
- completedAt: z.string().nullable(),
1900
- completedByUserId: z.string().nullable(),
1901
- createdAt: z.string(),
1902
- updatedAt: z.string(),
1903
- createdByUserId: z.string().nullable()
1868
+ /**
1869
+ * Single acq_deal_tasks row (camelCase API representation).
1870
+ * Matches AcqDealTask domain type from types.ts.
1871
+ */
1872
+ export const DealTaskResponseSchema = z.object({
1873
+ id: z.string(),
1874
+ organizationId: z.string(),
1875
+ dealId: z.string(),
1876
+ title: z.string(),
1877
+ description: z.string().nullable(),
1878
+ kind: AcqDealTaskKindSchema,
1879
+ dueAt: z.string().nullable(),
1880
+ assigneeUserId: z.string().nullable(),
1881
+ completedAt: z.string().nullable(),
1882
+ completedByUserId: z.string().nullable(),
1883
+ createdAt: z.string(),
1884
+ updatedAt: z.string(),
1885
+ createdByUserId: z.string().nullable()
1904
1886
  })
1905
1887
  ```
1906
1888
 
@@ -1913,44 +1895,44 @@ export const DealTaskListResponseSchema = z.array(DealTaskResponseSchema)
1913
1895
  ### `DealSchemas`
1914
1896
 
1915
1897
  ```typescript
1916
- export const DealSchemas = {
1917
- // Primitives
1918
- CrmStageKey: CrmStageKeySchema,
1919
- CrmStateKey: CrmStateKeySchema,
1920
- DealStage: DealStageSchema,
1921
-
1922
- // Params
1923
- DealIdParams: DealIdParamsSchema,
1924
- DealTaskIdParams: DealTaskIdParamsSchema,
1925
-
1926
- // Queries
1927
- ListDealsQuery: ListDealsQuerySchema,
1928
- DealLookupQuery: DealLookupQuerySchema,
1929
- ListDealTasksDueQuery: ListDealTasksDueQuerySchema,
1930
-
1931
- // Request bodies
1932
- CreateDealNoteRequest: CreateDealNoteRequestSchema,
1933
- CreateDealTaskRequest: CreateDealTaskRequestSchema,
1934
- TransitionItemRequest: CrmTransitionItemRequestSchema,
1935
- TransitionDealStateRequest: TransitionDealStateRequestSchema,
1936
- ExecuteActionParams: ExecuteActionParamsSchema,
1937
- ExecuteActionRequest: ExecuteActionRequestSchema,
1938
-
1939
- // Responses
1940
- DealPriority: DealPrioritySchema,
1941
- DealListResponse: DealListResponseSchema,
1942
- DealSummaryResponse: DealSummaryResponseSchema,
1943
- DealLookupResponse: DealLookupResponseSchema,
1944
- ConversationMessage: ConversationMessageSchema,
1945
- DealLineageListRef: DealLineageListRefSchema,
1946
- DealLineageProjectRef: DealLineageProjectRefSchema,
1947
- DealLineageClientRef: DealLineageClientRefSchema,
1948
- DealLineage: DealLineageSchema,
1949
- DealDetailResponse: DealDetailResponseSchema,
1950
- DealNoteResponse: DealNoteResponseSchema,
1951
- DealNoteListResponse: DealNoteListResponseSchema,
1952
- DealTaskResponse: DealTaskResponseSchema,
1953
- DealTaskListResponse: DealTaskListResponseSchema
1898
+ export const DealSchemas = {
1899
+ // Primitives
1900
+ CrmStageKey: CrmStageKeySchema,
1901
+ CrmStateKey: CrmStateKeySchema,
1902
+ DealStage: DealStageSchema,
1903
+
1904
+ // Params
1905
+ DealIdParams: DealIdParamsSchema,
1906
+ DealTaskIdParams: DealTaskIdParamsSchema,
1907
+
1908
+ // Queries
1909
+ ListDealsQuery: ListDealsQuerySchema,
1910
+ DealLookupQuery: DealLookupQuerySchema,
1911
+ ListDealTasksDueQuery: ListDealTasksDueQuerySchema,
1912
+
1913
+ // Request bodies
1914
+ CreateDealNoteRequest: CreateDealNoteRequestSchema,
1915
+ CreateDealTaskRequest: CreateDealTaskRequestSchema,
1916
+ TransitionItemRequest: CrmTransitionItemRequestSchema,
1917
+ TransitionDealStateRequest: TransitionDealStateRequestSchema,
1918
+ ExecuteActionParams: ExecuteActionParamsSchema,
1919
+ ExecuteActionRequest: ExecuteActionRequestSchema,
1920
+
1921
+ // Responses
1922
+ DealPriority: DealPrioritySchema,
1923
+ DealListResponse: DealListResponseSchema,
1924
+ DealSummaryResponse: DealSummaryResponseSchema,
1925
+ DealLookupResponse: DealLookupResponseSchema,
1926
+ ConversationMessage: ConversationMessageSchema,
1927
+ DealLineageListRef: DealLineageListRefSchema,
1928
+ DealLineageProjectRef: DealLineageProjectRefSchema,
1929
+ DealLineageClientRef: DealLineageClientRefSchema,
1930
+ DealLineage: DealLineageSchema,
1931
+ DealDetailResponse: DealDetailResponseSchema,
1932
+ DealNoteResponse: DealNoteResponseSchema,
1933
+ DealNoteListResponse: DealNoteListResponseSchema,
1934
+ DealTaskResponse: DealTaskResponseSchema,
1935
+ DealTaskListResponse: DealTaskListResponseSchema
1954
1936
  }
1955
1937
  ```
1956
1938
 
@@ -1976,79 +1958,22 @@ export interface ActionDef {
1976
1958
  }
1977
1959
  ```
1978
1960
 
1979
- ### `DEFAULT_CRM_ACTIONS`
1980
-
1981
- ```typescript
1982
- export const DEFAULT_CRM_ACTIONS: ActionDef[] = [
1983
- crmAction('move_to_proposal', {
1984
- isAvailableFor: (deal) => deal.stage_key === 'interested'
1985
- }),
1986
- crmAction('move_to_closing', {
1987
- isAvailableFor: (deal) => deal.stage_key === 'proposal'
1988
- }),
1989
- crmAction('move_to_closed_won', {
1990
- isAvailableFor: (deal) => deal.stage_key === 'closing'
1991
- }),
1992
- crmAction('move_to_closed_lost', {
1993
- isAvailableFor: (deal) =>
1994
- deal.stage_key === 'interested' || deal.stage_key === 'proposal' || deal.stage_key === 'closing'
1995
- }),
1996
- crmAction('move_to_nurturing', {
1997
- isAvailableFor: (deal) =>
1998
- deal.stage_key === 'interested' || deal.stage_key === 'proposal' || deal.stage_key === 'closing'
1999
- }),
2000
- crmAction('send_reply', {
2001
- isAvailableFor: (deal) =>
2002
- deal.stage_key === 'interested' &&
2003
- isOurReplyAction(deal) &&
2004
- (deal.state_key === CRM_DISCOVERY_REPLIED_STATE.stateKey ||
2005
- deal.state_key === CRM_DISCOVERY_LINK_SENT_STATE.stateKey ||
2006
- deal.state_key === CRM_DISCOVERY_NUDGING_STATE.stateKey),
2007
- payloadSchema: SendReplyActionPayloadSchema
2008
- }),
2009
- crmAction('send_link', {
2010
- isAvailableFor: (deal) =>
2011
- deal.stage_key === 'interested' && deal.state_key === CRM_DISCOVERY_REPLIED_STATE.stateKey
2012
- }),
2013
- crmAction('send_nudge', {
2014
- isAvailableFor: (deal) =>
2015
- deal.stage_key === 'interested' &&
2016
- (deal.state_key === CRM_DISCOVERY_LINK_SENT_STATE.stateKey ||
2017
- deal.state_key === CRM_DISCOVERY_NUDGING_STATE.stateKey)
2018
- }),
2019
- {
2020
- key: 'mark_no_show',
2021
- label: 'Mark No-Show',
2022
- isAvailableFor: (deal) =>
2023
- deal.stage_key === 'interested' && deal.state_key === CRM_DISCOVERY_NUDGING_STATE.stateKey,
2024
- // Mirrors the auto-timeout precedent in operations/sales/crm/pipeline/timeout-actions.ts:
2025
- // both manual-click and timeout move the deal to closed_lost. The action_taken activity
2026
- // event captures operator intent and distinguishes the manual variant from the timed one.
2027
- workflowId: 'mark_no_show-workflow'
2028
- },
2029
- crmAction('rebook', {
2030
- isAvailableFor: (deal) =>
2031
- deal.stage_key === 'interested' && deal.state_key === CRM_DISCOVERY_BOOKING_CANCELLED_STATE.stateKey
2032
- })
2033
- ]
2034
- ```
2035
-
2036
1961
  ### `CrmToolMap`
2037
1962
 
2038
1963
  ```typescript
2039
- export type CrmToolMap = {
2040
- getRecentActivity: { params: CrmRecentActivityParams; result: RecentActivityEntry[] }
2041
- listDeals: { params: CrmListDealsParams; result: DealListItem[] }
2042
- getDeal: { params: CrmGetDealParams; result: DealDetail | null }
2043
- getDealByEmail: { params: CrmGetDealByEmailParams; result: DealDetail | null }
2044
- createDealNote: { params: CrmDealNoteParams; result: AcqDealNote }
2045
- listDealNotes: { params: Omit<ListDealNotesParams, 'organizationId'>; result: AcqDealNote[] }
2046
- createDealTask: { params: CrmDealTaskParams; result: AcqDealTask }
2047
- listDealTasks: { params: Omit<ListDealTasksParams, 'organizationId'>; result: AcqDealTask[] }
2048
- listDealTasksDue: { params: CrmTaskDueParams; result: AcqDealTask[] }
2049
- completeDealTask: { params: Omit<CompleteDealTaskParams, 'organizationId'>; result: AcqDealTask }
2050
- recordActivity: { params: CrmRecordActivityParams; result: void }
2051
- deleteDeal: { params: CrmDeleteDealParams; result: void }
1964
+ export type CrmToolMap = {
1965
+ getRecentActivity: { params: CrmRecentActivityParams; result: RecentActivityEntry[] }
1966
+ listDeals: { params: CrmListDealsParams; result: DealListItem[] }
1967
+ getDeal: { params: CrmGetDealParams; result: DealDetail | null }
1968
+ getDealByEmail: { params: CrmGetDealByEmailParams; result: DealDetail | null }
1969
+ createDealNote: { params: CrmDealNoteParams; result: AcqDealNote }
1970
+ listDealNotes: { params: Omit<ListDealNotesParams, 'organizationId'>; result: AcqDealNote[] }
1971
+ createDealTask: { params: CrmDealTaskParams; result: AcqDealTask }
1972
+ listDealTasks: { params: Omit<ListDealTasksParams, 'organizationId'>; result: AcqDealTask[] }
1973
+ listDealTasksDue: { params: CrmTaskDueParams; result: AcqDealTask[] }
1974
+ completeDealTask: { params: Omit<CompleteDealTaskParams, 'organizationId'>; result: AcqDealTask }
1975
+ recordActivity: { params: CrmRecordActivityParams; result: void }
1976
+ deleteDeal: { params: CrmDeleteDealParams; result: void }
2052
1977
  }
2053
1978
  ```
2054
1979
 
@@ -2279,180 +2204,180 @@ export interface ListTelemetry {
2279
2204
  ### `ListStageCountsSchema`
2280
2205
 
2281
2206
  ```typescript
2282
- export const ListStageCountsSchema = z.object({
2283
- // Attempted counts by canonical lead-gen stage. The detailed status
2284
- // distribution lives on ListProgress; telemetry keeps the overview payload small.
2285
- stageCounts: z.object({
2286
- populated: z.number().int(),
2287
- extracted: z.number().int(),
2288
- qualified: z.number().int(),
2289
- discovered: z.number().int(),
2290
- verified: z.number().int(),
2291
- personalized: z.number().int(),
2292
- uploaded: z.number().int()
2293
- }),
2294
- deliverability: z.object({
2295
- valid: z.number().int(),
2296
- risky: z.number().int(),
2297
- invalid: z.number().int(),
2298
- unknown: z.number().int(),
2299
- bounced: z.number().int()
2300
- })
2207
+ export const ListStageCountsSchema = z.object({
2208
+ // Attempted counts by canonical lead-gen stage. The detailed status
2209
+ // distribution lives on ListProgress; telemetry keeps the overview payload small.
2210
+ stageCounts: z.object({
2211
+ populated: z.number().int(),
2212
+ extracted: z.number().int(),
2213
+ qualified: z.number().int(),
2214
+ discovered: z.number().int(),
2215
+ verified: z.number().int(),
2216
+ personalized: z.number().int(),
2217
+ uploaded: z.number().int()
2218
+ }),
2219
+ deliverability: z.object({
2220
+ valid: z.number().int(),
2221
+ risky: z.number().int(),
2222
+ invalid: z.number().int(),
2223
+ unknown: z.number().int(),
2224
+ bounced: z.number().int()
2225
+ })
2301
2226
  })
2302
2227
  ```
2303
2228
 
2304
2229
  ### `ListTelemetrySchema`
2305
2230
 
2306
2231
  ```typescript
2307
- export const ListTelemetrySchema = z.object({
2308
- listId: UuidSchema,
2309
- totalCompanies: z.number().int(),
2310
- totalContacts: z.number().int(),
2311
- stageCounts: ListStageCountsSchema.shape.stageCounts,
2312
- deliverability: ListStageCountsSchema.shape.deliverability,
2313
- activeWorkflows: z.array(z.string()).optional()
2232
+ export const ListTelemetrySchema = z.object({
2233
+ listId: UuidSchema,
2234
+ totalCompanies: z.number().int(),
2235
+ totalContacts: z.number().int(),
2236
+ stageCounts: ListStageCountsSchema.shape.stageCounts,
2237
+ deliverability: ListStageCountsSchema.shape.deliverability,
2238
+ activeWorkflows: z.array(z.string()).optional()
2314
2239
  })
2315
2240
  ```
2316
2241
 
2317
2242
  ### `ListIdParamsSchema`
2318
2243
 
2319
2244
  ```typescript
2320
- export const ListIdParamsSchema = z.object({
2321
- listId: UuidSchema
2245
+ export const ListIdParamsSchema = z.object({
2246
+ listId: UuidSchema
2322
2247
  })
2323
2248
  ```
2324
2249
 
2325
2250
  ### `CreateListRequestSchema`
2326
2251
 
2327
2252
  ```typescript
2328
- export const CreateListRequestSchema = z
2329
- .object({
2330
- name: z.string().trim().min(1).max(255),
2331
- description: z.string().trim().nullable().optional(),
2332
- status: ListStatusSchema.optional(),
2333
- buildTemplateId: ProspectingBuildTemplateIdSchema.optional(),
2334
- scrapingConfig: ScrapingConfigSchema.optional(),
2335
- icp: IcpRubricSchema.optional(),
2336
- pipelineConfig: PipelineConfigSchema.optional()
2337
- })
2253
+ export const CreateListRequestSchema = z
2254
+ .object({
2255
+ name: z.string().trim().min(1).max(255),
2256
+ description: z.string().trim().nullable().optional(),
2257
+ status: ListStatusSchema.optional(),
2258
+ buildTemplateId: ProspectingBuildTemplateIdSchema.optional(),
2259
+ scrapingConfig: ScrapingConfigSchema.optional(),
2260
+ icp: IcpRubricSchema.optional(),
2261
+ pipelineConfig: PipelineConfigSchema.optional()
2262
+ })
2338
2263
  .strict()
2339
2264
  ```
2340
2265
 
2341
2266
  ### `UpdateListRequestSchema`
2342
2267
 
2343
2268
  ```typescript
2344
- export const UpdateListRequestSchema = z
2345
- .object({
2346
- name: z.string().trim().min(1).max(255).optional(),
2347
- description: z.string().trim().nullable().optional(),
2348
- batchIds: z.array(z.string()).optional(),
2349
- buildTemplateId: ProspectingBuildTemplateIdSchema.optional(),
2350
- confirmBuildTemplateChange: z.literal(true).optional()
2351
- })
2352
- .strict()
2353
- .refine(
2354
- (data) =>
2355
- data.name !== undefined ||
2356
- data.description !== undefined ||
2357
- data.batchIds !== undefined ||
2358
- data.buildTemplateId !== undefined,
2359
- {
2360
- message: 'At least one field (name, description, batchIds, or buildTemplateId) must be provided'
2361
- }
2362
- )
2363
- .refine((data) => data.buildTemplateId === undefined || data.confirmBuildTemplateChange === true, {
2364
- message: 'confirmBuildTemplateChange must be true when changing buildTemplateId',
2365
- path: ['confirmBuildTemplateChange']
2269
+ export const UpdateListRequestSchema = z
2270
+ .object({
2271
+ name: z.string().trim().min(1).max(255).optional(),
2272
+ description: z.string().trim().nullable().optional(),
2273
+ batchIds: z.array(z.string()).optional(),
2274
+ buildTemplateId: ProspectingBuildTemplateIdSchema.optional(),
2275
+ confirmBuildTemplateChange: z.literal(true).optional()
2276
+ })
2277
+ .strict()
2278
+ .refine(
2279
+ (data) =>
2280
+ data.name !== undefined ||
2281
+ data.description !== undefined ||
2282
+ data.batchIds !== undefined ||
2283
+ data.buildTemplateId !== undefined,
2284
+ {
2285
+ message: 'At least one field (name, description, batchIds, or buildTemplateId) must be provided'
2286
+ }
2287
+ )
2288
+ .refine((data) => data.buildTemplateId === undefined || data.confirmBuildTemplateChange === true, {
2289
+ message: 'confirmBuildTemplateChange must be true when changing buildTemplateId',
2290
+ path: ['confirmBuildTemplateChange']
2366
2291
  })
2367
2292
  ```
2368
2293
 
2369
2294
  ### `UpdateListConfigRequestSchema`
2370
2295
 
2371
2296
  ```typescript
2372
- /**
2373
- * Partial patch for the three jsonb config columns. UI sends only the edited
2374
- * subtree; server writes the field as-is (no deep merge — each column is
2375
- * replaced atomically when present in the patch).
2376
- */
2377
- export const UpdateListConfigRequestSchema = z
2378
- .object({
2379
- scrapingConfig: ScrapingConfigSchema.partial().optional(),
2380
- icp: IcpRubricSchema.partial().optional(),
2381
- pipelineConfig: PipelineConfigSchema.partial().optional()
2382
- })
2383
- .strict()
2384
- .refine((data) => data.scrapingConfig !== undefined || data.icp !== undefined || data.pipelineConfig !== undefined, {
2385
- message: 'At least one of scrapingConfig, icp, or pipelineConfig must be provided'
2297
+ /**
2298
+ * Partial patch for the three jsonb config columns. UI sends only the edited
2299
+ * subtree; server writes the field as-is (no deep merge — each column is
2300
+ * replaced atomically when present in the patch).
2301
+ */
2302
+ export const UpdateListConfigRequestSchema = z
2303
+ .object({
2304
+ scrapingConfig: ScrapingConfigSchema.partial().optional(),
2305
+ icp: IcpRubricSchema.partial().optional(),
2306
+ pipelineConfig: PipelineConfigSchema.partial().optional()
2307
+ })
2308
+ .strict()
2309
+ .refine((data) => data.scrapingConfig !== undefined || data.icp !== undefined || data.pipelineConfig !== undefined, {
2310
+ message: 'At least one of scrapingConfig, icp, or pipelineConfig must be provided'
2386
2311
  })
2387
2312
  ```
2388
2313
 
2389
2314
  ### `AddCompaniesToListRequestSchema`
2390
2315
 
2391
2316
  ```typescript
2392
- export const AddCompaniesToListRequestSchema = z
2393
- .object({
2394
- companyIds: z.array(UuidSchema).min(1).max(1000)
2395
- })
2317
+ export const AddCompaniesToListRequestSchema = z
2318
+ .object({
2319
+ companyIds: z.array(UuidSchema).min(1).max(1000)
2320
+ })
2396
2321
  .strict()
2397
2322
  ```
2398
2323
 
2399
2324
  ### `RemoveCompaniesFromListRequestSchema`
2400
2325
 
2401
2326
  ```typescript
2402
- export const RemoveCompaniesFromListRequestSchema = z
2403
- .object({
2404
- companyIds: z.array(UuidSchema).min(1).max(1000)
2405
- })
2327
+ export const RemoveCompaniesFromListRequestSchema = z
2328
+ .object({
2329
+ companyIds: z.array(UuidSchema).min(1).max(1000)
2330
+ })
2406
2331
  .strict()
2407
2332
  ```
2408
2333
 
2409
2334
  ### `AddContactsToListRequestSchema`
2410
2335
 
2411
2336
  ```typescript
2412
- export const AddContactsToListRequestSchema = z
2413
- .object({
2414
- contactIds: z.array(UuidSchema).min(1).max(1000)
2415
- })
2337
+ export const AddContactsToListRequestSchema = z
2338
+ .object({
2339
+ contactIds: z.array(UuidSchema).min(1).max(1000)
2340
+ })
2416
2341
  .strict()
2417
2342
  ```
2418
2343
 
2419
2344
  ### `RecordListExecutionRequestSchema`
2420
2345
 
2421
2346
  ```typescript
2422
- export const RecordListExecutionRequestSchema = z
2423
- .object({
2424
- executionId: UuidSchema,
2425
- configSnapshot: z.record(z.string(), z.unknown()).optional()
2426
- })
2347
+ export const RecordListExecutionRequestSchema = z
2348
+ .object({
2349
+ executionId: UuidSchema,
2350
+ configSnapshot: z.record(z.string(), z.unknown()).optional()
2351
+ })
2427
2352
  .strict()
2428
2353
  ```
2429
2354
 
2430
2355
  ### `AcqListResponseSchema`
2431
2356
 
2432
2357
  ```typescript
2433
- /**
2434
- * Single list as returned by /api/acquisition/lists/:id etc.
2435
- * Camel-cased domain shape matching AcqList in types.ts.
2436
- */
2437
- export const AcqListResponseSchema = z.object({
2438
- id: z.string(),
2439
- organizationId: z.string(),
2440
- name: z.string(),
2441
- description: z.string().nullable(),
2442
- batchIds: z.array(z.string()),
2443
- instantlyCampaignId: z.string().nullable(),
2444
- /** Lifecycle status (draft | enriching | launched | closing | archived). */
2445
- status: ListStatusSchema,
2446
- metadata: AcqListMetadataSchema,
2447
- launchedAt: z.string().nullable(),
2448
- completedAt: z.string().nullable(),
2449
- createdAt: z.string(),
2450
- /** Scraping criteria stored as jsonb on the row. */
2451
- scrapingConfig: ScrapingConfigSchema,
2452
- /** ICP / qualification rubric stored as jsonb on the row. */
2453
- icp: IcpRubricSchema,
2454
- /** Pipeline presentation contract stored as jsonb on the row. */
2455
- pipelineConfig: PipelineConfigSchema
2358
+ /**
2359
+ * Single list as returned by /api/acquisition/lists/:id etc.
2360
+ * Camel-cased domain shape matching AcqList in types.ts.
2361
+ */
2362
+ export const AcqListResponseSchema = z.object({
2363
+ id: z.string(),
2364
+ organizationId: z.string(),
2365
+ name: z.string(),
2366
+ description: z.string().nullable(),
2367
+ batchIds: z.array(z.string()),
2368
+ instantlyCampaignId: z.string().nullable(),
2369
+ /** Lifecycle status (draft | enriching | launched | closing | archived). */
2370
+ status: ListStatusSchema,
2371
+ metadata: AcqListMetadataSchema,
2372
+ launchedAt: z.string().nullable(),
2373
+ completedAt: z.string().nullable(),
2374
+ createdAt: z.string(),
2375
+ /** Scraping criteria stored as jsonb on the row. */
2376
+ scrapingConfig: ScrapingConfigSchema,
2377
+ /** ICP / qualification rubric stored as jsonb on the row. */
2378
+ icp: IcpRubricSchema,
2379
+ /** Pipeline presentation contract stored as jsonb on the row. */
2380
+ pipelineConfig: PipelineConfigSchema
2456
2381
  })
2457
2382
  ```
2458
2383
 
@@ -2477,18 +2402,18 @@ export const ListTelemetryListResponseSchema = z.array(ListTelemetrySchema)
2477
2402
  ### `ListExecutionSummarySchema`
2478
2403
 
2479
2404
  ```typescript
2480
- /**
2481
- * Row from acq_list_executions joined with the execution summary,
2482
- * shaped for the /lists/:id/executions response.
2483
- */
2484
- export const ListExecutionSummarySchema = z.object({
2485
- executionId: z.string(),
2486
- resourceId: z.string(),
2487
- status: z.string(),
2488
- createdAt: z.string(),
2489
- completedAt: z.string().nullable(),
2490
- durationMs: z.number().int().nullable(),
2491
- input: z.unknown().nullable().optional()
2405
+ /**
2406
+ * Row from acq_list_executions joined with the execution summary,
2407
+ * shaped for the /lists/:id/executions response.
2408
+ */
2409
+ export const ListExecutionSummarySchema = z.object({
2410
+ executionId: z.string(),
2411
+ resourceId: z.string(),
2412
+ status: z.string(),
2413
+ createdAt: z.string(),
2414
+ completedAt: z.string().nullable(),
2415
+ durationMs: z.number().int().nullable(),
2416
+ input: z.unknown().nullable().optional()
2492
2417
  })
2493
2418
  ```
2494
2419
 
@@ -2519,299 +2444,299 @@ export const AcqEmailValidSchema = z.enum(['VALID', 'INVALID', 'RISKY', 'UNKNOWN
2519
2444
  ### `CompanyIdParamsSchema`
2520
2445
 
2521
2446
  ```typescript
2522
- export const CompanyIdParamsSchema = z.object({
2523
- companyId: UuidSchema
2447
+ export const CompanyIdParamsSchema = z.object({
2448
+ companyId: UuidSchema
2524
2449
  })
2525
2450
  ```
2526
2451
 
2527
2452
  ### `ContactIdParamsSchema`
2528
2453
 
2529
2454
  ```typescript
2530
- export const ContactIdParamsSchema = z.object({
2531
- contactId: UuidSchema
2455
+ export const ContactIdParamsSchema = z.object({
2456
+ contactId: UuidSchema
2532
2457
  })
2533
2458
  ```
2534
2459
 
2535
2460
  ### `ListCompaniesQuerySchema`
2536
2461
 
2537
2462
  ```typescript
2538
- export const ListCompaniesQuerySchema = z
2539
- .object({
2540
- search: z.string().trim().min(1).max(200).optional(),
2541
- listId: UuidSchema.optional(),
2542
- domain: z.string().trim().min(1).max(255).optional(),
2543
- website: z.string().trim().min(1).max(2048).optional(),
2544
- segment: z.string().trim().min(1).max(255).optional(),
2545
- category: z.string().trim().min(1).max(255).optional(),
2546
- pipelineStatus: z.unknown().optional(),
2547
- batchId: z.string().trim().min(1).max(255).optional(),
2548
- status: AcqCompanyStatusSchema.optional(),
2549
- includeAll: QueryBooleanSchema.optional(),
2550
- limit: z.coerce.number().int().min(1).max(5000).default(50),
2551
- offset: z.coerce.number().int().min(0).default(0)
2552
- })
2463
+ export const ListCompaniesQuerySchema = z
2464
+ .object({
2465
+ search: z.string().trim().min(1).max(200).optional(),
2466
+ listId: UuidSchema.optional(),
2467
+ domain: z.string().trim().min(1).max(255).optional(),
2468
+ website: z.string().trim().min(1).max(2048).optional(),
2469
+ segment: z.string().trim().min(1).max(255).optional(),
2470
+ category: z.string().trim().min(1).max(255).optional(),
2471
+ pipelineStatus: z.unknown().optional(),
2472
+ batchId: z.string().trim().min(1).max(255).optional(),
2473
+ status: AcqCompanyStatusSchema.optional(),
2474
+ includeAll: QueryBooleanSchema.optional(),
2475
+ limit: z.coerce.number().int().min(1).max(5000).default(50),
2476
+ offset: z.coerce.number().int().min(0).default(0)
2477
+ })
2553
2478
  .strict()
2554
2479
  ```
2555
2480
 
2556
2481
  ### `ListContactsQuerySchema`
2557
2482
 
2558
2483
  ```typescript
2559
- export const ListContactsQuerySchema = z
2560
- .object({
2561
- search: z.string().trim().min(1).max(200).optional(),
2562
- listId: UuidSchema.optional(),
2563
- openingLineIsNull: QueryBooleanSchema.optional(),
2564
- batchId: z.string().trim().min(1).max(255).optional(),
2565
- contactStatus: AcqContactStatusSchema.optional(),
2566
- limit: z.coerce.number().int().min(1).max(5000).default(5000),
2567
- offset: z.coerce.number().int().min(0).default(0)
2568
- })
2484
+ export const ListContactsQuerySchema = z
2485
+ .object({
2486
+ search: z.string().trim().min(1).max(200).optional(),
2487
+ listId: UuidSchema.optional(),
2488
+ openingLineIsNull: QueryBooleanSchema.optional(),
2489
+ batchId: z.string().trim().min(1).max(255).optional(),
2490
+ contactStatus: AcqContactStatusSchema.optional(),
2491
+ limit: z.coerce.number().int().min(1).max(5000).default(5000),
2492
+ offset: z.coerce.number().int().min(0).default(0)
2493
+ })
2569
2494
  .strict()
2570
2495
  ```
2571
2496
 
2572
2497
  ### `CreateCompanyRequestSchema`
2573
2498
 
2574
2499
  ```typescript
2575
- export const CreateCompanyRequestSchema = z
2576
- .object({
2577
- name: z.string().trim().min(1).max(255),
2578
- clientId: UuidSchema.nullable().optional(),
2579
- domain: z.string().trim().min(1).max(255).optional(),
2580
- linkedinUrl: z.string().trim().url().optional(),
2581
- website: z.string().trim().url().optional(),
2582
- numEmployees: z.number().int().min(0).optional(),
2583
- foundedYear: z.number().int().optional(),
2584
- locationCity: z.string().trim().min(1).max(255).optional(),
2585
- locationState: z.string().trim().min(1).max(255).optional(),
2586
- category: z.string().trim().min(1).max(255).optional(),
2587
- source: z.string().trim().min(1).max(255).optional(),
2588
- batchId: z.string().trim().min(1).max(255).optional(),
2589
- pipelineStatus: z.unknown().optional(),
2590
- verticalResearch: z.string().trim().min(1).max(5000).optional()
2591
- })
2500
+ export const CreateCompanyRequestSchema = z
2501
+ .object({
2502
+ name: z.string().trim().min(1).max(255),
2503
+ clientId: UuidSchema.nullable().optional(),
2504
+ domain: z.string().trim().min(1).max(255).optional(),
2505
+ linkedinUrl: z.string().trim().url().optional(),
2506
+ website: z.string().trim().url().optional(),
2507
+ numEmployees: z.number().int().min(0).optional(),
2508
+ foundedYear: z.number().int().optional(),
2509
+ locationCity: z.string().trim().min(1).max(255).optional(),
2510
+ locationState: z.string().trim().min(1).max(255).optional(),
2511
+ category: z.string().trim().min(1).max(255).optional(),
2512
+ source: z.string().trim().min(1).max(255).optional(),
2513
+ batchId: z.string().trim().min(1).max(255).optional(),
2514
+ pipelineStatus: z.unknown().optional(),
2515
+ verticalResearch: z.string().trim().min(1).max(5000).optional()
2516
+ })
2592
2517
  .strict()
2593
2518
  ```
2594
2519
 
2595
2520
  ### `UpdateCompanyRequestSchema`
2596
2521
 
2597
2522
  ```typescript
2598
- export const UpdateCompanyRequestSchema = z
2599
- .object({
2600
- name: z.string().trim().min(1).max(255).optional(),
2601
- clientId: UuidSchema.nullable().optional(),
2602
- domain: z.string().trim().min(1).max(255).optional(),
2603
- linkedinUrl: z.string().trim().url().optional(),
2604
- website: z.string().trim().url().optional(),
2605
- numEmployees: z.number().int().min(0).optional(),
2606
- foundedYear: z.number().int().optional(),
2607
- locationCity: z.string().trim().min(1).max(255).optional(),
2608
- locationState: z.string().trim().min(1).max(255).optional(),
2609
- category: z.string().trim().min(1).max(255).optional(),
2610
- segment: z.string().trim().min(1).max(255).optional(),
2611
- processingState: CompanyProcessingStateSchema.optional(),
2612
- pipelineStatus: z.unknown().optional(),
2613
- enrichmentData: z.record(z.string(), z.unknown()).optional(),
2614
- source: z.string().trim().min(1).max(255).optional(),
2615
- batchId: z.string().trim().min(1).max(255).optional(),
2616
- status: AcqCompanyStatusSchema.optional(),
2617
- verticalResearch: z.string().trim().min(1).max(5000).nullable().optional()
2618
- })
2619
- .strict()
2620
- .refine(
2621
- (data) =>
2622
- data.name !== undefined ||
2623
- data.clientId !== undefined ||
2624
- data.domain !== undefined ||
2625
- data.linkedinUrl !== undefined ||
2626
- data.website !== undefined ||
2627
- data.numEmployees !== undefined ||
2628
- data.foundedYear !== undefined ||
2629
- data.locationCity !== undefined ||
2630
- data.locationState !== undefined ||
2631
- data.category !== undefined ||
2632
- data.segment !== undefined ||
2633
- data.processingState !== undefined ||
2634
- data.pipelineStatus !== undefined ||
2635
- data.enrichmentData !== undefined ||
2636
- data.source !== undefined ||
2637
- data.batchId !== undefined ||
2638
- data.status !== undefined ||
2639
- data.verticalResearch !== undefined,
2640
- {
2641
- message: 'At least one field must be provided'
2642
- }
2523
+ export const UpdateCompanyRequestSchema = z
2524
+ .object({
2525
+ name: z.string().trim().min(1).max(255).optional(),
2526
+ clientId: UuidSchema.nullable().optional(),
2527
+ domain: z.string().trim().min(1).max(255).optional(),
2528
+ linkedinUrl: z.string().trim().url().optional(),
2529
+ website: z.string().trim().url().optional(),
2530
+ numEmployees: z.number().int().min(0).optional(),
2531
+ foundedYear: z.number().int().optional(),
2532
+ locationCity: z.string().trim().min(1).max(255).optional(),
2533
+ locationState: z.string().trim().min(1).max(255).optional(),
2534
+ category: z.string().trim().min(1).max(255).optional(),
2535
+ segment: z.string().trim().min(1).max(255).optional(),
2536
+ processingState: CompanyProcessingStateSchema.optional(),
2537
+ pipelineStatus: z.unknown().optional(),
2538
+ enrichmentData: z.record(z.string(), z.unknown()).optional(),
2539
+ source: z.string().trim().min(1).max(255).optional(),
2540
+ batchId: z.string().trim().min(1).max(255).optional(),
2541
+ status: AcqCompanyStatusSchema.optional(),
2542
+ verticalResearch: z.string().trim().min(1).max(5000).nullable().optional()
2543
+ })
2544
+ .strict()
2545
+ .refine(
2546
+ (data) =>
2547
+ data.name !== undefined ||
2548
+ data.clientId !== undefined ||
2549
+ data.domain !== undefined ||
2550
+ data.linkedinUrl !== undefined ||
2551
+ data.website !== undefined ||
2552
+ data.numEmployees !== undefined ||
2553
+ data.foundedYear !== undefined ||
2554
+ data.locationCity !== undefined ||
2555
+ data.locationState !== undefined ||
2556
+ data.category !== undefined ||
2557
+ data.segment !== undefined ||
2558
+ data.processingState !== undefined ||
2559
+ data.pipelineStatus !== undefined ||
2560
+ data.enrichmentData !== undefined ||
2561
+ data.source !== undefined ||
2562
+ data.batchId !== undefined ||
2563
+ data.status !== undefined ||
2564
+ data.verticalResearch !== undefined,
2565
+ {
2566
+ message: 'At least one field must be provided'
2567
+ }
2643
2568
  )
2644
2569
  ```
2645
2570
 
2646
2571
  ### `CreateContactRequestSchema`
2647
2572
 
2648
2573
  ```typescript
2649
- export const CreateContactRequestSchema = z
2650
- .object({
2651
- email: z.string().trim().email(),
2652
- clientId: UuidSchema.nullable().optional(),
2653
- companyId: UuidSchema.optional(),
2654
- firstName: z.string().trim().min(1).max(255).optional(),
2655
- lastName: z.string().trim().min(1).max(255).optional(),
2656
- linkedinUrl: z.string().trim().url().optional(),
2657
- title: z.string().trim().min(1).max(255).optional(),
2658
- source: z.string().trim().min(1).max(255).optional(),
2659
- sourceId: z.string().trim().min(1).max(255).optional(),
2660
- batchId: z.string().trim().min(1).max(255).optional(),
2661
- pipelineStatus: z.unknown().optional()
2662
- })
2574
+ export const CreateContactRequestSchema = z
2575
+ .object({
2576
+ email: z.string().trim().email(),
2577
+ clientId: UuidSchema.nullable().optional(),
2578
+ companyId: UuidSchema.optional(),
2579
+ firstName: z.string().trim().min(1).max(255).optional(),
2580
+ lastName: z.string().trim().min(1).max(255).optional(),
2581
+ linkedinUrl: z.string().trim().url().optional(),
2582
+ title: z.string().trim().min(1).max(255).optional(),
2583
+ source: z.string().trim().min(1).max(255).optional(),
2584
+ sourceId: z.string().trim().min(1).max(255).optional(),
2585
+ batchId: z.string().trim().min(1).max(255).optional(),
2586
+ pipelineStatus: z.unknown().optional()
2587
+ })
2663
2588
  .strict()
2664
2589
  ```
2665
2590
 
2666
2591
  ### `UpdateContactRequestSchema`
2667
2592
 
2668
2593
  ```typescript
2669
- export const UpdateContactRequestSchema = z
2670
- .object({
2671
- companyId: UuidSchema.optional(),
2672
- clientId: UuidSchema.nullable().optional(),
2673
- emailValid: AcqEmailValidSchema.optional(),
2674
- firstName: z.string().trim().min(1).max(255).optional(),
2675
- lastName: z.string().trim().min(1).max(255).optional(),
2676
- linkedinUrl: z.string().trim().url().optional(),
2677
- title: z.string().trim().min(1).max(255).optional(),
2678
- headline: z.string().trim().min(1).max(5000).optional(),
2679
- filterReason: z.string().trim().min(1).max(5000).optional(),
2680
- openingLine: z.string().trim().min(1).max(5000).optional(),
2681
- processingState: ContactProcessingStateSchema.optional(),
2682
- pipelineStatus: z.unknown().optional(),
2683
- enrichmentData: z.record(z.string(), z.unknown()).optional(),
2684
- status: AcqContactStatusSchema.optional()
2685
- })
2686
- .strict()
2687
- .refine(
2688
- (data) =>
2689
- data.companyId !== undefined ||
2690
- data.clientId !== undefined ||
2691
- data.emailValid !== undefined ||
2692
- data.firstName !== undefined ||
2693
- data.lastName !== undefined ||
2694
- data.linkedinUrl !== undefined ||
2695
- data.title !== undefined ||
2696
- data.headline !== undefined ||
2697
- data.filterReason !== undefined ||
2698
- data.openingLine !== undefined ||
2699
- data.processingState !== undefined ||
2700
- data.pipelineStatus !== undefined ||
2701
- data.enrichmentData !== undefined ||
2702
- data.status !== undefined,
2703
- {
2704
- message: 'At least one field must be provided'
2705
- }
2594
+ export const UpdateContactRequestSchema = z
2595
+ .object({
2596
+ companyId: UuidSchema.optional(),
2597
+ clientId: UuidSchema.nullable().optional(),
2598
+ emailValid: AcqEmailValidSchema.optional(),
2599
+ firstName: z.string().trim().min(1).max(255).optional(),
2600
+ lastName: z.string().trim().min(1).max(255).optional(),
2601
+ linkedinUrl: z.string().trim().url().optional(),
2602
+ title: z.string().trim().min(1).max(255).optional(),
2603
+ headline: z.string().trim().min(1).max(5000).optional(),
2604
+ filterReason: z.string().trim().min(1).max(5000).optional(),
2605
+ openingLine: z.string().trim().min(1).max(5000).optional(),
2606
+ processingState: ContactProcessingStateSchema.optional(),
2607
+ pipelineStatus: z.unknown().optional(),
2608
+ enrichmentData: z.record(z.string(), z.unknown()).optional(),
2609
+ status: AcqContactStatusSchema.optional()
2610
+ })
2611
+ .strict()
2612
+ .refine(
2613
+ (data) =>
2614
+ data.companyId !== undefined ||
2615
+ data.clientId !== undefined ||
2616
+ data.emailValid !== undefined ||
2617
+ data.firstName !== undefined ||
2618
+ data.lastName !== undefined ||
2619
+ data.linkedinUrl !== undefined ||
2620
+ data.title !== undefined ||
2621
+ data.headline !== undefined ||
2622
+ data.filterReason !== undefined ||
2623
+ data.openingLine !== undefined ||
2624
+ data.processingState !== undefined ||
2625
+ data.pipelineStatus !== undefined ||
2626
+ data.enrichmentData !== undefined ||
2627
+ data.status !== undefined,
2628
+ {
2629
+ message: 'At least one field must be provided'
2630
+ }
2706
2631
  )
2707
2632
  ```
2708
2633
 
2709
2634
  ### `AcqCompanyResponseSchema`
2710
2635
 
2711
2636
  ```typescript
2712
- export const AcqCompanyResponseSchema = z.object({
2713
- id: z.string(),
2714
- organizationId: z.string(),
2715
- clientId: z.string().nullable().optional(),
2716
- name: z.string(),
2717
- domain: z.string().nullable(),
2718
- linkedinUrl: z.string().nullable(),
2719
- website: z.string().nullable(),
2720
- numEmployees: z.number().nullable(),
2721
- foundedYear: z.number().nullable(),
2722
- locationCity: z.string().nullable(),
2723
- locationState: z.string().nullable(),
2724
- category: z.string().nullable(),
2725
- categoryPain: z.string().nullable(),
2726
- segment: z.string().nullable(),
2727
- processingState: CompanyProcessingStateSchema.nullable(),
2728
- pipelineStatus: z.unknown().nullable().optional(),
2729
- enrichmentData: z.record(z.string(), z.unknown()).nullable(),
2730
- source: z.string().nullable(),
2731
- batchId: z.string().nullable(),
2732
- status: AcqCompanyStatusSchema,
2733
- contactCount: z.number().int().min(0),
2734
- verticalResearch: z.string().nullable(),
2735
- createdAt: z.string(),
2736
- updatedAt: z.string()
2637
+ export const AcqCompanyResponseSchema = z.object({
2638
+ id: z.string(),
2639
+ organizationId: z.string(),
2640
+ clientId: z.string().nullable().optional(),
2641
+ name: z.string(),
2642
+ domain: z.string().nullable(),
2643
+ linkedinUrl: z.string().nullable(),
2644
+ website: z.string().nullable(),
2645
+ numEmployees: z.number().nullable(),
2646
+ foundedYear: z.number().nullable(),
2647
+ locationCity: z.string().nullable(),
2648
+ locationState: z.string().nullable(),
2649
+ category: z.string().nullable(),
2650
+ categoryPain: z.string().nullable(),
2651
+ segment: z.string().nullable(),
2652
+ processingState: CompanyProcessingStateSchema.nullable(),
2653
+ pipelineStatus: z.unknown().nullable().optional(),
2654
+ enrichmentData: z.record(z.string(), z.unknown()).nullable(),
2655
+ source: z.string().nullable(),
2656
+ batchId: z.string().nullable(),
2657
+ status: AcqCompanyStatusSchema,
2658
+ contactCount: z.number().int().min(0),
2659
+ verticalResearch: z.string().nullable(),
2660
+ createdAt: z.string(),
2661
+ updatedAt: z.string()
2737
2662
  })
2738
2663
  ```
2739
2664
 
2740
2665
  ### `AcqCompanyListResponseSchema`
2741
2666
 
2742
2667
  ```typescript
2743
- export const AcqCompanyListResponseSchema = z.object({
2744
- data: z.array(AcqCompanyResponseSchema),
2745
- total: z.number().int(),
2746
- limit: z.number().int(),
2747
- offset: z.number().int()
2668
+ export const AcqCompanyListResponseSchema = z.object({
2669
+ data: z.array(AcqCompanyResponseSchema),
2670
+ total: z.number().int(),
2671
+ limit: z.number().int(),
2672
+ offset: z.number().int()
2748
2673
  })
2749
2674
  ```
2750
2675
 
2751
2676
  ### `AcqCompanyFacetsResponseSchema`
2752
2677
 
2753
2678
  ```typescript
2754
- export const AcqCompanyFacetsResponseSchema = z.object({
2755
- segments: z.array(z.string()),
2756
- categories: z.array(z.string()),
2757
- statuses: z.array(AcqCompanyStatusSchema)
2679
+ export const AcqCompanyFacetsResponseSchema = z.object({
2680
+ segments: z.array(z.string()),
2681
+ categories: z.array(z.string()),
2682
+ statuses: z.array(AcqCompanyStatusSchema)
2758
2683
  })
2759
2684
  ```
2760
2685
 
2761
2686
  ### `AcqContactCompanySummarySchema`
2762
2687
 
2763
2688
  ```typescript
2764
- export const AcqContactCompanySummarySchema = z.object({
2765
- id: z.string(),
2766
- name: z.string(),
2767
- domain: z.string().nullable(),
2768
- website: z.string().nullable(),
2769
- linkedinUrl: z.string().nullable(),
2770
- segment: z.string().nullable(),
2771
- category: z.string().nullable(),
2772
- status: AcqCompanyStatusSchema
2689
+ export const AcqContactCompanySummarySchema = z.object({
2690
+ id: z.string(),
2691
+ name: z.string(),
2692
+ domain: z.string().nullable(),
2693
+ website: z.string().nullable(),
2694
+ linkedinUrl: z.string().nullable(),
2695
+ segment: z.string().nullable(),
2696
+ category: z.string().nullable(),
2697
+ status: AcqCompanyStatusSchema
2773
2698
  })
2774
2699
  ```
2775
2700
 
2776
2701
  ### `AcqContactResponseSchema`
2777
2702
 
2778
2703
  ```typescript
2779
- export const AcqContactResponseSchema = z.object({
2780
- id: z.string(),
2781
- organizationId: z.string(),
2782
- clientId: z.string().nullable().optional(),
2783
- companyId: z.string().nullable(),
2784
- email: z.string(),
2785
- emailValid: AcqEmailValidSchema.nullable(),
2786
- firstName: z.string().nullable(),
2787
- lastName: z.string().nullable(),
2788
- linkedinUrl: z.string().nullable(),
2789
- title: z.string().nullable(),
2790
- headline: z.string().nullable(),
2791
- filterReason: z.string().nullable(),
2792
- openingLine: z.string().nullable(),
2793
- source: z.string().nullable(),
2794
- sourceId: z.string().nullable(),
2795
- processingState: ContactProcessingStateSchema.nullable(),
2796
- pipelineStatus: z.unknown().nullable().optional(),
2797
- enrichmentData: z.record(z.string(), z.unknown()).nullable(),
2798
- attioPersonId: z.string().nullable(),
2799
- batchId: z.string().nullable(),
2800
- status: AcqContactStatusSchema,
2801
- company: AcqContactCompanySummarySchema.nullable().optional(),
2802
- createdAt: z.string(),
2803
- updatedAt: z.string()
2704
+ export const AcqContactResponseSchema = z.object({
2705
+ id: z.string(),
2706
+ organizationId: z.string(),
2707
+ clientId: z.string().nullable().optional(),
2708
+ companyId: z.string().nullable(),
2709
+ email: z.string(),
2710
+ emailValid: AcqEmailValidSchema.nullable(),
2711
+ firstName: z.string().nullable(),
2712
+ lastName: z.string().nullable(),
2713
+ linkedinUrl: z.string().nullable(),
2714
+ title: z.string().nullable(),
2715
+ headline: z.string().nullable(),
2716
+ filterReason: z.string().nullable(),
2717
+ openingLine: z.string().nullable(),
2718
+ source: z.string().nullable(),
2719
+ sourceId: z.string().nullable(),
2720
+ processingState: ContactProcessingStateSchema.nullable(),
2721
+ pipelineStatus: z.unknown().nullable().optional(),
2722
+ enrichmentData: z.record(z.string(), z.unknown()).nullable(),
2723
+ attioPersonId: z.string().nullable(),
2724
+ batchId: z.string().nullable(),
2725
+ status: AcqContactStatusSchema,
2726
+ company: AcqContactCompanySummarySchema.nullable().optional(),
2727
+ createdAt: z.string(),
2728
+ updatedAt: z.string()
2804
2729
  })
2805
2730
  ```
2806
2731
 
2807
2732
  ### `AcqContactListResponseSchema`
2808
2733
 
2809
2734
  ```typescript
2810
- export const AcqContactListResponseSchema = z.object({
2811
- data: z.array(AcqContactResponseSchema),
2812
- total: z.number().int(),
2813
- limit: z.number().int(),
2814
- offset: z.number().int()
2735
+ export const AcqContactListResponseSchema = z.object({
2736
+ data: z.array(AcqContactResponseSchema),
2737
+ total: z.number().int(),
2738
+ limit: z.number().int(),
2739
+ offset: z.number().int()
2815
2740
  })
2816
2741
  ```
2817
2742
 
@@ -2824,242 +2749,242 @@ export const AcqArtifactOwnerKindSchema = z.enum(['company', 'contact', 'deal',
2824
2749
  ### `ListArtifactsQuerySchema`
2825
2750
 
2826
2751
  ```typescript
2827
- export const ListArtifactsQuerySchema = z
2828
- .object({
2829
- ownerKind: AcqArtifactOwnerKindSchema,
2830
- ownerId: UuidSchema
2831
- })
2752
+ export const ListArtifactsQuerySchema = z
2753
+ .object({
2754
+ ownerKind: AcqArtifactOwnerKindSchema,
2755
+ ownerId: UuidSchema
2756
+ })
2832
2757
  .strict()
2833
2758
  ```
2834
2759
 
2835
2760
  ### `CreateArtifactRequestSchema`
2836
2761
 
2837
2762
  ```typescript
2838
- export const CreateArtifactRequestSchema = z
2839
- .object({
2840
- ownerKind: AcqArtifactOwnerKindSchema,
2841
- ownerId: UuidSchema,
2842
- kind: z.string().trim().min(1).max(255),
2843
- content: z.record(z.string(), z.unknown()),
2844
- sourceExecutionId: UuidSchema.optional()
2845
- })
2763
+ export const CreateArtifactRequestSchema = z
2764
+ .object({
2765
+ ownerKind: AcqArtifactOwnerKindSchema,
2766
+ ownerId: UuidSchema,
2767
+ kind: z.string().trim().min(1).max(255),
2768
+ content: z.record(z.string(), z.unknown()),
2769
+ sourceExecutionId: UuidSchema.optional()
2770
+ })
2846
2771
  .strict()
2847
2772
  ```
2848
2773
 
2849
2774
  ### `AcqArtifactResponseSchema`
2850
2775
 
2851
2776
  ```typescript
2852
- export const AcqArtifactResponseSchema = z.object({
2853
- id: z.string(),
2854
- organizationId: z.string(),
2855
- ownerKind: z.string(),
2856
- ownerId: z.string(),
2857
- kind: z.string(),
2858
- content: z.record(z.string(), z.unknown()),
2859
- sourceExecutionId: z.string().nullable(),
2860
- createdBy: z.string().nullable(),
2861
- createdAt: z.string(),
2862
- version: z.number().int()
2777
+ export const AcqArtifactResponseSchema = z.object({
2778
+ id: z.string(),
2779
+ organizationId: z.string(),
2780
+ ownerKind: z.string(),
2781
+ ownerId: z.string(),
2782
+ kind: z.string(),
2783
+ content: z.record(z.string(), z.unknown()),
2784
+ sourceExecutionId: z.string().nullable(),
2785
+ createdBy: z.string().nullable(),
2786
+ createdAt: z.string(),
2787
+ version: z.number().int()
2863
2788
  })
2864
2789
  ```
2865
2790
 
2866
2791
  ### `AcqArtifactListResponseSchema`
2867
2792
 
2868
2793
  ```typescript
2869
- export const AcqArtifactListResponseSchema = z.object({
2870
- artifacts: z.array(AcqArtifactResponseSchema)
2794
+ export const AcqArtifactListResponseSchema = z.object({
2795
+ artifacts: z.array(AcqArtifactResponseSchema)
2871
2796
  })
2872
2797
  ```
2873
2798
 
2874
2799
  ### `ListMembersQuerySchema`
2875
2800
 
2876
2801
  ```typescript
2877
- export const ListMembersQuerySchema = z
2878
- .object({
2879
- limit: z.coerce.number().int().min(1).max(500).default(50),
2880
- offset: z.coerce.number().int().min(0).default(0)
2881
- })
2802
+ export const ListMembersQuerySchema = z
2803
+ .object({
2804
+ limit: z.coerce.number().int().min(1).max(500).default(50),
2805
+ offset: z.coerce.number().int().min(0).default(0)
2806
+ })
2882
2807
  .strict()
2883
2808
  ```
2884
2809
 
2885
2810
  ### `MemberIdParamsSchema`
2886
2811
 
2887
2812
  ```typescript
2888
- export const MemberIdParamsSchema = z.object({
2889
- memberId: UuidSchema
2813
+ export const MemberIdParamsSchema = z.object({
2814
+ memberId: UuidSchema
2890
2815
  })
2891
2816
  ```
2892
2817
 
2893
2818
  ### `AcqListMemberContactSummarySchema`
2894
2819
 
2895
2820
  ```typescript
2896
- export const AcqListMemberContactSummarySchema = z.object({
2897
- id: z.string(),
2898
- email: z.string(),
2899
- firstName: z.string().nullable(),
2900
- lastName: z.string().nullable(),
2901
- title: z.string().nullable(),
2902
- linkedinUrl: z.string().nullable(),
2903
- companyId: z.string().nullable()
2821
+ export const AcqListMemberContactSummarySchema = z.object({
2822
+ id: z.string(),
2823
+ email: z.string(),
2824
+ firstName: z.string().nullable(),
2825
+ lastName: z.string().nullable(),
2826
+ title: z.string().nullable(),
2827
+ linkedinUrl: z.string().nullable(),
2828
+ companyId: z.string().nullable()
2904
2829
  })
2905
2830
  ```
2906
2831
 
2907
2832
  ### `AcqListMemberResponseSchema`
2908
2833
 
2909
2834
  ```typescript
2910
- export const AcqListMemberResponseSchema = z.object({
2911
- id: z.string(),
2912
- listId: z.string(),
2913
- contactId: z.string(),
2914
- pipelineKey: z.string(),
2915
- stageKey: z.string(),
2916
- stateKey: z.string(),
2917
- activityLog: z.unknown(),
2918
- addedAt: z.string(),
2919
- addedBy: z.string().nullable(),
2920
- sourceExecutionId: z.string().nullable(),
2921
- contact: AcqListMemberContactSummarySchema.nullable()
2835
+ export const AcqListMemberResponseSchema = z.object({
2836
+ id: z.string(),
2837
+ listId: z.string(),
2838
+ contactId: z.string(),
2839
+ pipelineKey: z.string(),
2840
+ stageKey: z.string(),
2841
+ stateKey: z.string(),
2842
+ activityLog: z.unknown(),
2843
+ addedAt: z.string(),
2844
+ addedBy: z.string().nullable(),
2845
+ sourceExecutionId: z.string().nullable(),
2846
+ contact: AcqListMemberContactSummarySchema.nullable()
2922
2847
  })
2923
2848
  ```
2924
2849
 
2925
2850
  ### `AcqListMembersResponseSchema`
2926
2851
 
2927
2852
  ```typescript
2928
- export const AcqListMembersResponseSchema = z.object({
2929
- members: z.array(AcqListMemberResponseSchema)
2853
+ export const AcqListMembersResponseSchema = z.object({
2854
+ members: z.array(AcqListMemberResponseSchema)
2930
2855
  })
2931
2856
  ```
2932
2857
 
2933
2858
  ### `ListCompanyIdParamsSchema`
2934
2859
 
2935
2860
  ```typescript
2936
- export const ListCompanyIdParamsSchema = z.object({
2937
- listCompanyId: UuidSchema
2861
+ export const ListCompanyIdParamsSchema = z.object({
2862
+ listCompanyId: UuidSchema
2938
2863
  })
2939
2864
  ```
2940
2865
 
2941
2866
  ### `AcqListCompanyResponseSchema`
2942
2867
 
2943
2868
  ```typescript
2944
- export const AcqListCompanyResponseSchema = z.object({
2945
- id: z.string(),
2946
- listId: z.string(),
2947
- companyId: z.string(),
2948
- pipelineKey: z.string(),
2949
- stageKey: z.string(),
2950
- stateKey: z.string(),
2951
- activityLog: z.unknown(),
2952
- addedAt: z.string(),
2953
- addedBy: z.string().nullable(),
2954
- sourceExecutionId: z.string().nullable()
2869
+ export const AcqListCompanyResponseSchema = z.object({
2870
+ id: z.string(),
2871
+ listId: z.string(),
2872
+ companyId: z.string(),
2873
+ pipelineKey: z.string(),
2874
+ stageKey: z.string(),
2875
+ stateKey: z.string(),
2876
+ activityLog: z.unknown(),
2877
+ addedAt: z.string(),
2878
+ addedBy: z.string().nullable(),
2879
+ sourceExecutionId: z.string().nullable()
2955
2880
  })
2956
2881
  ```
2957
2882
 
2958
2883
  ### `AcqCompanySchemas`
2959
2884
 
2960
2885
  ```typescript
2961
- export const AcqCompanySchemas = {
2962
- CompanyProcessingState: CompanyProcessingStateSchema,
2963
- CompanyIdParams: CompanyIdParamsSchema,
2964
- ListCompaniesQuery: ListCompaniesQuerySchema,
2965
- CreateCompanyRequest: CreateCompanyRequestSchema,
2966
- UpdateCompanyRequest: UpdateCompanyRequestSchema,
2967
- AcqCompanyResponse: AcqCompanyResponseSchema,
2968
- AcqCompanyListResponse: AcqCompanyListResponseSchema,
2969
- AcqCompanyFacetsResponse: AcqCompanyFacetsResponseSchema
2886
+ export const AcqCompanySchemas = {
2887
+ CompanyProcessingState: CompanyProcessingStateSchema,
2888
+ CompanyIdParams: CompanyIdParamsSchema,
2889
+ ListCompaniesQuery: ListCompaniesQuerySchema,
2890
+ CreateCompanyRequest: CreateCompanyRequestSchema,
2891
+ UpdateCompanyRequest: UpdateCompanyRequestSchema,
2892
+ AcqCompanyResponse: AcqCompanyResponseSchema,
2893
+ AcqCompanyListResponse: AcqCompanyListResponseSchema,
2894
+ AcqCompanyFacetsResponse: AcqCompanyFacetsResponseSchema
2970
2895
  }
2971
2896
  ```
2972
2897
 
2973
2898
  ### `AcqContactSchemas`
2974
2899
 
2975
2900
  ```typescript
2976
- export const AcqContactSchemas = {
2977
- ContactProcessingState: ContactProcessingStateSchema,
2978
- ContactIdParams: ContactIdParamsSchema,
2979
- ListContactsQuery: ListContactsQuerySchema,
2980
- CreateContactRequest: CreateContactRequestSchema,
2981
- UpdateContactRequest: UpdateContactRequestSchema,
2982
- AcqContactResponse: AcqContactResponseSchema,
2983
- AcqContactListResponse: AcqContactListResponseSchema
2901
+ export const AcqContactSchemas = {
2902
+ ContactProcessingState: ContactProcessingStateSchema,
2903
+ ContactIdParams: ContactIdParamsSchema,
2904
+ ListContactsQuery: ListContactsQuerySchema,
2905
+ CreateContactRequest: CreateContactRequestSchema,
2906
+ UpdateContactRequest: UpdateContactRequestSchema,
2907
+ AcqContactResponse: AcqContactResponseSchema,
2908
+ AcqContactListResponse: AcqContactListResponseSchema
2984
2909
  }
2985
2910
  ```
2986
2911
 
2987
2912
  ### `AcqListSchemas`
2988
2913
 
2989
2914
  ```typescript
2990
- export const AcqListSchemas = {
2991
- // Params
2992
- ListIdParams: ListIdParamsSchema,
2993
-
2994
- // Primitives (for UI / tests)
2995
- ListStatus: ListStatusSchema,
2996
- ScrapingConfig: ScrapingConfigSchema,
2997
- IcpRubric: IcpRubricSchema,
2998
- PipelineConfig: PipelineConfigSchema,
2999
- PipelineStage: PipelineStageSchema,
3000
- BuildPlanSnapshot: BuildPlanSnapshotSchema,
3001
- BuildPlanSnapshotStep: BuildPlanSnapshotStepSchema,
3002
- AcqListMetadata: AcqListMetadataSchema,
3003
- LeadGenStageKey: LeadGenStageKeySchema,
3004
- LeadGenActionKey: LeadGenActionKeySchema,
3005
- ProcessingStageStatus: ProcessingStageStatusSchema,
3006
- ProcessingState: ProcessingStateSchema,
3007
- ListStageCounts: ListStageCountsSchema,
3008
- ListTelemetry: ListTelemetrySchema,
3009
-
3010
- // Requests
3011
- ListReadQuery: ListReadQuerySchema,
3012
- GetListQuery: GetListQuerySchema,
3013
- CreateListRequest: CreateListRequestSchema,
3014
- UpdateListRequest: UpdateListRequestSchema,
3015
- UpdateListStatusRequest: UpdateListStatusRequestSchema,
3016
- UpdateListConfigRequest: UpdateListConfigRequestSchema,
3017
- AddCompaniesToListRequest: AddCompaniesToListRequestSchema,
3018
- RemoveCompaniesFromListRequest: RemoveCompaniesFromListRequestSchema,
3019
- AddContactsToListRequest: AddContactsToListRequestSchema,
3020
- RecordListExecutionRequest: RecordListExecutionRequestSchema,
3021
-
3022
- // Responses
3023
- AcqListResponse: AcqListResponseSchema,
3024
- AcqListDetailResponse: AcqListDetailResponseSchema,
3025
- AcqListListResponse: AcqListListResponseSchema,
3026
- AcqListDealRef: AcqListDealRefSchema,
3027
- AcqListLineage: AcqListLineageSchema,
3028
- AcqListStatusResponse: AcqListStatusResponseSchema,
3029
- ListTelemetryResponse: ListTelemetryResponseSchema,
3030
- ListTelemetryListResponse: ListTelemetryListResponseSchema,
3031
- ListExecutionsResponse: ListExecutionsResponseSchema,
3032
- ListProgressResponse: ListProgressResponseSchema
2915
+ export const AcqListSchemas = {
2916
+ // Params
2917
+ ListIdParams: ListIdParamsSchema,
2918
+
2919
+ // Primitives (for UI / tests)
2920
+ ListStatus: ListStatusSchema,
2921
+ ScrapingConfig: ScrapingConfigSchema,
2922
+ IcpRubric: IcpRubricSchema,
2923
+ PipelineConfig: PipelineConfigSchema,
2924
+ PipelineStage: PipelineStageSchema,
2925
+ BuildPlanSnapshot: BuildPlanSnapshotSchema,
2926
+ BuildPlanSnapshotStep: BuildPlanSnapshotStepSchema,
2927
+ AcqListMetadata: AcqListMetadataSchema,
2928
+ LeadGenStageKey: LeadGenStageKeySchema,
2929
+ LeadGenActionKey: LeadGenActionKeySchema,
2930
+ ProcessingStageStatus: ProcessingStageStatusSchema,
2931
+ ProcessingState: ProcessingStateSchema,
2932
+ ListStageCounts: ListStageCountsSchema,
2933
+ ListTelemetry: ListTelemetrySchema,
2934
+
2935
+ // Requests
2936
+ ListReadQuery: ListReadQuerySchema,
2937
+ GetListQuery: GetListQuerySchema,
2938
+ CreateListRequest: CreateListRequestSchema,
2939
+ UpdateListRequest: UpdateListRequestSchema,
2940
+ UpdateListStatusRequest: UpdateListStatusRequestSchema,
2941
+ UpdateListConfigRequest: UpdateListConfigRequestSchema,
2942
+ AddCompaniesToListRequest: AddCompaniesToListRequestSchema,
2943
+ RemoveCompaniesFromListRequest: RemoveCompaniesFromListRequestSchema,
2944
+ AddContactsToListRequest: AddContactsToListRequestSchema,
2945
+ RecordListExecutionRequest: RecordListExecutionRequestSchema,
2946
+
2947
+ // Responses
2948
+ AcqListResponse: AcqListResponseSchema,
2949
+ AcqListDetailResponse: AcqListDetailResponseSchema,
2950
+ AcqListListResponse: AcqListListResponseSchema,
2951
+ AcqListDealRef: AcqListDealRefSchema,
2952
+ AcqListLineage: AcqListLineageSchema,
2953
+ AcqListStatusResponse: AcqListStatusResponseSchema,
2954
+ ListTelemetryResponse: ListTelemetryResponseSchema,
2955
+ ListTelemetryListResponse: ListTelemetryListResponseSchema,
2956
+ ListExecutionsResponse: ListExecutionsResponseSchema,
2957
+ ListProgressResponse: ListProgressResponseSchema
3033
2958
  }
3034
2959
  ```
3035
2960
 
3036
2961
  ### `AcqSubstrateSchemas`
3037
2962
 
3038
2963
  ```typescript
3039
- export const AcqSubstrateSchemas = {
3040
- // Artifacts
3041
- ListArtifactsQuery: ListArtifactsQuerySchema,
3042
- CreateArtifactRequest: CreateArtifactRequestSchema,
3043
- AcqArtifactResponse: AcqArtifactResponseSchema,
3044
- AcqArtifactListResponse: AcqArtifactListResponseSchema,
3045
-
3046
- // List members
3047
- ListMembersQuery: ListMembersQuerySchema,
3048
- ListRecordsQuery: ListRecordsQuerySchema,
3049
- MemberIdParams: MemberIdParamsSchema,
3050
- AcqListMemberResponse: AcqListMemberResponseSchema,
3051
- AcqListMembersResponse: AcqListMembersResponseSchema,
3052
- AcqListCompanyRecordRow: AcqListCompanyRecordRowSchema,
3053
- AcqListContactRecordRow: AcqListContactRecordRowSchema,
3054
- ListRecordRow: ListRecordRowSchema,
3055
- ListRecordsResponse: ListRecordsResponseSchema,
3056
-
3057
- // List companies
3058
- ListCompanyIdParams: ListCompanyIdParamsSchema,
3059
- AcqListCompanyResponse: AcqListCompanyResponseSchema,
3060
-
3061
- // Transition (generic stateful substrate)
3062
- TransitionItemRequest: TransitionItemRequestSchema
2964
+ export const AcqSubstrateSchemas = {
2965
+ // Artifacts
2966
+ ListArtifactsQuery: ListArtifactsQuerySchema,
2967
+ CreateArtifactRequest: CreateArtifactRequestSchema,
2968
+ AcqArtifactResponse: AcqArtifactResponseSchema,
2969
+ AcqArtifactListResponse: AcqArtifactListResponseSchema,
2970
+
2971
+ // List members
2972
+ ListMembersQuery: ListMembersQuerySchema,
2973
+ ListRecordsQuery: ListRecordsQuerySchema,
2974
+ MemberIdParams: MemberIdParamsSchema,
2975
+ AcqListMemberResponse: AcqListMemberResponseSchema,
2976
+ AcqListMembersResponse: AcqListMembersResponseSchema,
2977
+ AcqListCompanyRecordRow: AcqListCompanyRecordRowSchema,
2978
+ AcqListContactRecordRow: AcqListContactRecordRowSchema,
2979
+ ListRecordRow: ListRecordRowSchema,
2980
+ ListRecordsResponse: ListRecordsResponseSchema,
2981
+
2982
+ // List companies
2983
+ ListCompanyIdParams: ListCompanyIdParamsSchema,
2984
+ AcqListCompanyResponse: AcqListCompanyResponseSchema,
2985
+
2986
+ // Transition (generic stateful substrate)
2987
+ TransitionItemRequest: TransitionItemRequestSchema
3063
2988
  }
3064
2989
  ```
3065
2990
 
@@ -3110,136 +3035,136 @@ export const StatefulSchema = z.object({
3110
3035
  ### `StatefulStateDefinition`
3111
3036
 
3112
3037
  ```typescript
3113
- /** One state within a stage minimal shape: key + display label. */
3114
- export interface StatefulStateDefinition {
3115
- /** Matches state_key values written by workflow steps. */
3116
- stateKey: string
3117
- label: string
3038
+ /** One state within a stage: minimal shape of key + display label. */
3039
+ export interface StatefulStateDefinition {
3040
+ /** Matches state_key values written by workflow steps. */
3041
+ stateKey: string
3042
+ label: string
3118
3043
  }
3119
3044
  ```
3120
3045
 
3121
3046
  ### `StatefulStageDefinition`
3122
3047
 
3123
3048
  ```typescript
3124
- /** One stage within a pipeline has a stage_key and an ordered list of valid states. */
3125
- export interface StatefulStageDefinition {
3126
- /** Matches stage_key values written by workflow steps. */
3127
- stageKey: string
3128
- label: string
3129
- /** UI color token. Consumers may map this to their design system. */
3130
- color?: string
3131
- states: StatefulStateDefinition[]
3049
+ /** One stage within a pipeline: has a stage_key and ordered valid states. */
3050
+ export interface StatefulStageDefinition {
3051
+ /** Matches stage_key values written by workflow steps. */
3052
+ stageKey: string
3053
+ label: string
3054
+ /** UI color token. Consumers may map this to their design system. */
3055
+ color?: string
3056
+ states: StatefulStateDefinition[]
3132
3057
  }
3133
3058
  ```
3134
3059
 
3135
3060
  ### `StatefulPipelineDefinition`
3136
3061
 
3137
3062
  ```typescript
3138
- /**
3139
- * Pipeline definition for a single entity participating in the Stateful trait.
3140
- * Parallel to acq_deals' pipeline_key concept but structured for lead-gen entities.
3141
- */
3142
- export interface StatefulPipelineDefinition {
3143
- /** Matches pipeline_key values in the database (e.g. 'lead-gen'). */
3144
- pipelineKey: string
3145
- label: string
3146
- /** Entity this pipeline applies to (e.g. 'acq.list', 'acq.list-member', 'acq.list-company'). */
3147
- entityKey: string
3148
- stages: StatefulStageDefinition[]
3063
+ /**
3064
+ * Pipeline definition for a single entity participating in the Stateful trait.
3065
+ * Parallel to acq_deals' pipeline_key concept but structured for any entity.
3066
+ */
3067
+ export interface StatefulPipelineDefinition {
3068
+ /** Matches pipeline_key values in the database. */
3069
+ pipelineKey: string
3070
+ label: string
3071
+ /** Entity this pipeline applies to. */
3072
+ entityKey: string
3073
+ stages: StatefulStageDefinition[]
3149
3074
  }
3150
3075
  ```
3151
3076
 
3152
3077
  ### `ACQ_LIST_MEMBERS_LEAD_GEN_PIPELINE`
3153
3078
 
3154
3079
  ```typescript
3155
- /**
3156
- * Lead-gen pipeline definition for acq_list_members (contacts).
3157
- * Three stages matching the post-restructure sales subdomain tree.
3158
- *
3159
- * Note: members visit outreach and prospecting states depending on which
3160
- * workflow last processed them. stage_key is set per-transition by the workflow.
3161
- */
3162
- export const ACQ_LIST_MEMBERS_LEAD_GEN_PIPELINE: StatefulPipelineDefinition = {
3163
- pipelineKey: 'lead-gen',
3164
- label: 'Lead Generation',
3165
- entityKey: 'acq.list-member',
3166
- stages: [
3167
- {
3168
- stageKey: 'outreach',
3169
- label: 'Outreach',
3170
- states: [
3171
- PENDING_STATE,
3172
- { stateKey: 'personalized', label: 'Personalized' },
3173
- { stateKey: 'uploaded', label: 'Uploaded' },
3174
- { stateKey: 'interested', label: 'Interested' }
3175
- ]
3176
- },
3177
- {
3178
- stageKey: 'prospecting',
3179
- label: 'Prospecting',
3180
- states: [
3181
- PENDING_STATE,
3182
- { stateKey: 'discovered', label: 'Discovered' },
3183
- { stateKey: 'verified', label: 'Verified' }
3184
- ]
3185
- },
3186
- {
3187
- stageKey: 'qualification',
3188
- label: 'Qualification',
3189
- states: [PENDING_STATE]
3190
- }
3191
- ]
3080
+ /**
3081
+ * Lead-gen pipeline definition for acq_list_members (contacts).
3082
+ * Three stages matching the post-restructure sales subdomain tree.
3083
+ *
3084
+ * Note: members visit outreach and prospecting states depending on which
3085
+ * workflow last processed them. stage_key is set per-transition by the workflow.
3086
+ */
3087
+ export const ACQ_LIST_MEMBERS_LEAD_GEN_PIPELINE: StatefulPipelineDefinition = {
3088
+ pipelineKey: 'lead-gen',
3089
+ label: 'Lead Generation',
3090
+ entityKey: 'acq.list-member',
3091
+ stages: [
3092
+ {
3093
+ stageKey: 'outreach',
3094
+ label: 'Outreach',
3095
+ states: [
3096
+ PENDING_STATE,
3097
+ { stateKey: 'personalized', label: 'Personalized' },
3098
+ { stateKey: 'uploaded', label: 'Uploaded' },
3099
+ { stateKey: 'interested', label: 'Interested' }
3100
+ ]
3101
+ },
3102
+ {
3103
+ stageKey: 'prospecting',
3104
+ label: 'Prospecting',
3105
+ states: [
3106
+ PENDING_STATE,
3107
+ { stateKey: 'discovered', label: 'Discovered' },
3108
+ { stateKey: 'verified', label: 'Verified' }
3109
+ ]
3110
+ },
3111
+ {
3112
+ stageKey: 'qualification',
3113
+ label: 'Qualification',
3114
+ states: [PENDING_STATE]
3115
+ }
3116
+ ]
3192
3117
  }
3193
3118
  ```
3194
3119
 
3195
3120
  ### `ACQ_LIST_COMPANIES_LEAD_GEN_PIPELINE`
3196
3121
 
3197
3122
  ```typescript
3198
- /**
3199
- * Lead-gen pipeline definition for acq_list_companies.
3200
- * Three stages matching the post-restructure sales subdomain tree.
3201
- *
3202
- * Note: companies visit prospecting and qualification states depending on which
3203
- * workflow last processed them. stage_key is set per-transition by the workflow.
3204
- */
3205
- export const ACQ_LIST_COMPANIES_LEAD_GEN_PIPELINE: StatefulPipelineDefinition = {
3206
- pipelineKey: 'lead-gen',
3207
- label: 'Lead Generation',
3208
- entityKey: 'acq.list-company',
3209
- stages: [
3210
- {
3211
- stageKey: 'outreach',
3212
- label: 'Outreach',
3213
- states: [PENDING_STATE, { stateKey: 'uploaded', label: 'Uploaded' }]
3214
- },
3215
- {
3216
- stageKey: 'prospecting',
3217
- label: 'Prospecting',
3218
- states: [
3219
- PENDING_STATE,
3220
- { stateKey: 'populated', label: 'Populated' },
3221
- { stateKey: 'extracted', label: 'Extracted' }
3222
- ]
3223
- },
3224
- {
3225
- stageKey: 'qualification',
3226
- label: 'Qualification',
3227
- states: [PENDING_STATE, { stateKey: 'qualified', label: 'Qualified' }]
3228
- }
3229
- ]
3123
+ /**
3124
+ * Lead-gen pipeline definition for acq_list_companies.
3125
+ * Three stages matching the post-restructure sales subdomain tree.
3126
+ *
3127
+ * Note: companies visit prospecting and qualification states depending on which
3128
+ * workflow last processed them. stage_key is set per-transition by the workflow.
3129
+ */
3130
+ export const ACQ_LIST_COMPANIES_LEAD_GEN_PIPELINE: StatefulPipelineDefinition = {
3131
+ pipelineKey: 'lead-gen',
3132
+ label: 'Lead Generation',
3133
+ entityKey: 'acq.list-company',
3134
+ stages: [
3135
+ {
3136
+ stageKey: 'outreach',
3137
+ label: 'Outreach',
3138
+ states: [PENDING_STATE, { stateKey: 'uploaded', label: 'Uploaded' }]
3139
+ },
3140
+ {
3141
+ stageKey: 'prospecting',
3142
+ label: 'Prospecting',
3143
+ states: [
3144
+ PENDING_STATE,
3145
+ { stateKey: 'populated', label: 'Populated' },
3146
+ { stateKey: 'extracted', label: 'Extracted' }
3147
+ ]
3148
+ },
3149
+ {
3150
+ stageKey: 'qualification',
3151
+ label: 'Qualification',
3152
+ states: [PENDING_STATE, { stateKey: 'qualified', label: 'Qualified' }]
3153
+ }
3154
+ ]
3230
3155
  }
3231
3156
  ```
3232
3157
 
3233
3158
  ### `LEAD_GEN_PIPELINE_DEFINITIONS`
3234
3159
 
3235
3160
  ```typescript
3236
- /**
3237
- * All lead-gen pipeline definitions indexed by entity key.
3238
- * Use findPipeline() to locate a definition by pipeline_key within any of these arrays.
3239
- */
3240
- export const LEAD_GEN_PIPELINE_DEFINITIONS: Record<string, StatefulPipelineDefinition[]> = {
3241
- 'acq.list-member': [ACQ_LIST_MEMBERS_LEAD_GEN_PIPELINE],
3242
- 'acq.list-company': [ACQ_LIST_COMPANIES_LEAD_GEN_PIPELINE]
3161
+ /**
3162
+ * All lead-gen pipeline definitions indexed by entity key.
3163
+ * Use findPipeline() to locate a definition by pipeline_key within any array.
3164
+ */
3165
+ export const LEAD_GEN_PIPELINE_DEFINITIONS: Record<string, StatefulPipelineDefinition[]> = {
3166
+ 'acq.list-member': [ACQ_LIST_MEMBERS_LEAD_GEN_PIPELINE],
3167
+ 'acq.list-company': [ACQ_LIST_COMPANIES_LEAD_GEN_PIPELINE]
3243
3168
  }
3244
3169
  ```
3245
3170
 
@@ -3655,168 +3580,168 @@ export interface BulkImportCompaniesResult {
3655
3580
  ### `LeadToolMap`
3656
3581
 
3657
3582
  ```typescript
3658
- export type LeadToolMap = {
3659
- // List operations
3660
- listLists: { params: Record<string, never>; result: AcqList[] }
3661
- createList: { params: Omit<CreateListParams, 'organizationId'>; result: AcqList }
3662
- updateList: { params: { id: string } & UpdateListParams; result: AcqList }
3663
- deleteList: { params: { id: string }; result: void }
3664
- addContactsToList: { params: Omit<AddContactsToListParams, 'organizationId'>; result: AddContactsToListResult }
3665
- addCompaniesToList: { params: Omit<AddCompaniesToListParams, 'organizationId'>; result: AddCompaniesToListResult }
3666
- updateCompanyStage: {
3667
- params: Omit<UpdateCompanyStageParams, 'organizationId'>
3668
- result: void
3669
- }
3670
- updateContactStage: {
3671
- params: Omit<UpdateContactStageParams, 'organizationId'>
3672
- result: void
3673
- }
3674
- // Company operations
3675
- createCompany: { params: Omit<CreateCompanyParams, 'organizationId'>; result: AcqCompany }
3676
- upsertCompany: { params: Omit<UpsertCompanyParams, 'organizationId'>; result: AcqCompany }
3677
- updateCompany: { params: { id: string } & UpdateCompanyParams; result: AcqCompany }
3678
- getCompany: { params: { id: string }; result: AcqCompany | null }
3679
- listCompanies: { params: CompanyFilters; result: AcqCompany[] }
3680
- deleteCompany: { params: { id: string }; result: void }
3681
- // Contact operations
3682
- createContact: { params: Omit<CreateContactParams, 'organizationId'>; result: AcqContact }
3683
- upsertContact: { params: Omit<UpsertContactParams, 'organizationId'>; result: AcqContact }
3684
- updateContact: { params: { id: string } & UpdateContactParams; result: AcqContact }
3685
- getContact: { params: { id: string }; result: AcqContact | null }
3686
- getContactByEmail: { params: { email: string }; result: AcqContact | null }
3687
- listContacts: {
3688
- params: ContactFilters & { limit?: number; offset?: number }
3689
- result: PaginatedResult<AcqContact>
3690
- }
3691
- deleteContact: { params: { id: string }; result: void }
3692
- bulkImportContacts: { params: Omit<BulkImportParams, 'organizationId'>; result: BulkImportResult }
3693
- bulkImportCompanies: {
3694
- params: Omit<BulkImportCompaniesParams, 'organizationId'>
3695
- result: BulkImportCompaniesResult
3696
- }
3697
- deactivateContactsByCompany: {
3698
- params: { companyId: string }
3699
- result: { deactivated: number }
3700
- }
3701
- // Deal operations
3702
- upsertDeal: { params: Omit<UpsertDealParams, 'organizationId'>; result: AcqDeal }
3703
- getDealByEmail: { params: { email: string }; result: AcqDeal | null }
3704
- getDealByEnvelopeId: { params: { envelopeId: string }; result: AcqDeal | null }
3705
- updateDealEnvelopeId: { params: { dealId: string; envelopeId: string }; result: AcqDeal | null }
3706
- getDealById: { params: Omit<GetDealByIdParams, 'organizationId'>; result: AcqDeal | null }
3707
- getContactById: { params: Omit<GetContactByIdParams, 'organizationId'>; result: AcqContact | null }
3708
- getCompanyById: { params: Omit<GetCompanyByIdParams, 'organizationId'>; result: AcqCompany | null }
3709
- // Deal-sync operations
3710
- updateDiscoveryData: { params: Omit<UpdateDiscoveryDataParams, 'organizationId'>; result: void }
3711
- updateProposalData: { params: Omit<UpdateProposalDataParams, 'organizationId'>; result: void }
3712
- markProposalSent: { params: Omit<MarkProposalSentParams, 'organizationId'>; result: void }
3713
- markProposalReviewed: { params: Omit<MarkProposalReviewedParams, 'organizationId'>; result: void }
3714
- updateCloseLostReason: { params: Omit<UpdateCloseLostReasonParams, 'organizationId'>; result: void }
3715
- updateFees: { params: Omit<UpdateFeesParams, 'organizationId'>; result: void }
3716
- cacheInstantlyThreadIds: { params: Omit<CacheInstantlyThreadIdsParams, 'organizationId'>; result: void }
3717
- transitionItem: { params: Omit<TransitionItemParams, 'organizationId'>; result: void }
3718
- setContactNurture: { params: Omit<SetContactNurtureParams, 'organizationId'>; result: void }
3719
- cancelSchedulesAndHitlByEmail: {
3720
- params: Omit<CancelSchedulesAndHitlByEmailParams, 'organizationId'>
3721
- result: { schedulesCancelled: number; hitlDeleted: number }
3722
- }
3723
- cancelHitlByDealId: { params: Omit<CancelHitlByDealIdParams, 'organizationId'>; result: { hitlDeleted: number } }
3724
- clearDealFields: { params: Omit<ClearDealFieldsParams, 'organizationId'>; result: void }
3725
- deleteDeal: { params: Omit<DeleteDealParams, 'organizationId'>; result: void }
3726
- recordDealActivity: {
3727
- params: Omit<RecordDealActivityParams, 'organizationId'>
3728
- result: void
3729
- }
3730
- // Deal note operations
3731
- createDealNote: {
3732
- params: Omit<CreateDealNoteParams, 'organizationId'>
3733
- result: AcqDealNote
3734
- }
3735
- listDealNotes: {
3736
- params: Omit<ListDealNotesParams, 'organizationId'>
3737
- result: AcqDealNote[]
3738
- }
3739
- // Deal task operations
3740
- createDealTask: {
3741
- params: Omit<CreateDealTaskParams, 'organizationId'>
3742
- result: AcqDealTask
3743
- }
3744
- listDealTasks: {
3745
- params: Omit<ListDealTasksParams, 'organizationId'>
3746
- result: AcqDealTask[]
3747
- }
3748
- listDealTasksDue: {
3749
- params: Omit<ListDealTasksDueParams, 'organizationId'>
3750
- result: AcqDealTask[]
3751
- }
3752
- completeDealTask: {
3753
- params: Omit<CompleteDealTaskParams, 'organizationId'>
3754
- result: AcqDealTask
3755
- }
3756
- // Deal query & analytics operations
3757
- listDeals: { params: DealFilters; result: AcqDeal[] }
3758
- getDealPipelineAnalytics: { params: { recentLimit?: number }; result: DealPipelineAnalytics }
3759
- // Enrichment data operations
3760
- mergeEnrichmentData: {
3761
- params: { id: string; table: 'acq_companies' | 'acq_contacts'; data: Record<string, unknown> }
3762
- result: void
3763
- }
3764
- // Social monitoring operations
3765
- upsertSocialPosts: {
3766
- params: { posts: Omit<UpsertSocialPostParams, 'organizationId'>[] }
3767
- result: UpsertSocialPostsResult
3768
- }
3769
- setDealStateKey: {
3770
- params: {
3771
- dealId: string
3772
- stateKey: string
3773
- }
3774
- result: { ok: true }
3775
- }
3776
- // CRM workflow helpers
3777
- transitionDeal: {
3778
- params: {
3779
- dealId: string
3780
- toStage: string
3781
- toState?: string
3782
- }
3783
- result: { deal: AcqDeal }
3784
- }
3785
- loadDeal: {
3786
- params: { dealId: string }
3787
- result: DealDetail | null
3788
- }
3583
+ export type LeadToolMap = {
3584
+ // List operations
3585
+ listLists: { params: Record<string, never>; result: AcqList[] }
3586
+ createList: { params: Omit<CreateListParams, 'organizationId'>; result: AcqList }
3587
+ updateList: { params: { id: string } & UpdateListParams; result: AcqList }
3588
+ deleteList: { params: { id: string }; result: void }
3589
+ addContactsToList: { params: Omit<AddContactsToListParams, 'organizationId'>; result: AddContactsToListResult }
3590
+ addCompaniesToList: { params: Omit<AddCompaniesToListParams, 'organizationId'>; result: AddCompaniesToListResult }
3591
+ updateCompanyStage: {
3592
+ params: Omit<UpdateCompanyStageParams, 'organizationId'>
3593
+ result: void
3594
+ }
3595
+ updateContactStage: {
3596
+ params: Omit<UpdateContactStageParams, 'organizationId'>
3597
+ result: void
3598
+ }
3599
+ // Company operations
3600
+ createCompany: { params: Omit<CreateCompanyParams, 'organizationId'>; result: AcqCompany }
3601
+ upsertCompany: { params: Omit<UpsertCompanyParams, 'organizationId'>; result: AcqCompany }
3602
+ updateCompany: { params: { id: string } & UpdateCompanyParams; result: AcqCompany }
3603
+ getCompany: { params: { id: string }; result: AcqCompany | null }
3604
+ listCompanies: { params: CompanyFilters; result: AcqCompany[] }
3605
+ deleteCompany: { params: { id: string }; result: void }
3606
+ // Contact operations
3607
+ createContact: { params: Omit<CreateContactParams, 'organizationId'>; result: AcqContact }
3608
+ upsertContact: { params: Omit<UpsertContactParams, 'organizationId'>; result: AcqContact }
3609
+ updateContact: { params: { id: string } & UpdateContactParams; result: AcqContact }
3610
+ getContact: { params: { id: string }; result: AcqContact | null }
3611
+ getContactByEmail: { params: { email: string }; result: AcqContact | null }
3612
+ listContacts: {
3613
+ params: ContactFilters & { limit?: number; offset?: number }
3614
+ result: PaginatedResult<AcqContact>
3615
+ }
3616
+ deleteContact: { params: { id: string }; result: void }
3617
+ bulkImportContacts: { params: Omit<BulkImportParams, 'organizationId'>; result: BulkImportResult }
3618
+ bulkImportCompanies: {
3619
+ params: Omit<BulkImportCompaniesParams, 'organizationId'>
3620
+ result: BulkImportCompaniesResult
3621
+ }
3622
+ deactivateContactsByCompany: {
3623
+ params: { companyId: string }
3624
+ result: { deactivated: number }
3625
+ }
3626
+ // Deal operations
3627
+ upsertDeal: { params: Omit<UpsertDealParams, 'organizationId'>; result: AcqDeal }
3628
+ getDealByEmail: { params: { email: string }; result: AcqDeal | null }
3629
+ getDealByEnvelopeId: { params: { envelopeId: string }; result: AcqDeal | null }
3630
+ updateDealEnvelopeId: { params: { dealId: string; envelopeId: string }; result: AcqDeal | null }
3631
+ getDealById: { params: Omit<GetDealByIdParams, 'organizationId'>; result: AcqDeal | null }
3632
+ getContactById: { params: Omit<GetContactByIdParams, 'organizationId'>; result: AcqContact | null }
3633
+ getCompanyById: { params: Omit<GetCompanyByIdParams, 'organizationId'>; result: AcqCompany | null }
3634
+ // Deal-sync operations
3635
+ updateDiscoveryData: { params: Omit<UpdateDiscoveryDataParams, 'organizationId'>; result: void }
3636
+ updateProposalData: { params: Omit<UpdateProposalDataParams, 'organizationId'>; result: void }
3637
+ markProposalSent: { params: Omit<MarkProposalSentParams, 'organizationId'>; result: void }
3638
+ markProposalReviewed: { params: Omit<MarkProposalReviewedParams, 'organizationId'>; result: void }
3639
+ updateCloseLostReason: { params: Omit<UpdateCloseLostReasonParams, 'organizationId'>; result: void }
3640
+ updateFees: { params: Omit<UpdateFeesParams, 'organizationId'>; result: void }
3641
+ cacheInstantlyThreadIds: { params: Omit<CacheInstantlyThreadIdsParams, 'organizationId'>; result: void }
3642
+ transitionItem: { params: Omit<TransitionItemParams, 'organizationId'>; result: void }
3643
+ setContactNurture: { params: Omit<SetContactNurtureParams, 'organizationId'>; result: void }
3644
+ cancelSchedulesAndHitlByEmail: {
3645
+ params: Omit<CancelSchedulesAndHitlByEmailParams, 'organizationId'>
3646
+ result: { schedulesCancelled: number; hitlDeleted: number }
3647
+ }
3648
+ cancelHitlByDealId: { params: Omit<CancelHitlByDealIdParams, 'organizationId'>; result: { hitlDeleted: number } }
3649
+ clearDealFields: { params: Omit<ClearDealFieldsParams, 'organizationId'>; result: void }
3650
+ deleteDeal: { params: Omit<DeleteDealParams, 'organizationId'>; result: void }
3651
+ recordDealActivity: {
3652
+ params: Omit<RecordDealActivityParams, 'organizationId'>
3653
+ result: void
3654
+ }
3655
+ // Deal note operations
3656
+ createDealNote: {
3657
+ params: Omit<CreateDealNoteParams, 'organizationId'>
3658
+ result: AcqDealNote
3659
+ }
3660
+ listDealNotes: {
3661
+ params: Omit<ListDealNotesParams, 'organizationId'>
3662
+ result: AcqDealNote[]
3663
+ }
3664
+ // Deal task operations
3665
+ createDealTask: {
3666
+ params: Omit<CreateDealTaskParams, 'organizationId'>
3667
+ result: AcqDealTask
3668
+ }
3669
+ listDealTasks: {
3670
+ params: Omit<ListDealTasksParams, 'organizationId'>
3671
+ result: AcqDealTask[]
3672
+ }
3673
+ listDealTasksDue: {
3674
+ params: Omit<ListDealTasksDueParams, 'organizationId'>
3675
+ result: AcqDealTask[]
3676
+ }
3677
+ completeDealTask: {
3678
+ params: Omit<CompleteDealTaskParams, 'organizationId'>
3679
+ result: AcqDealTask
3680
+ }
3681
+ // Deal query & analytics operations
3682
+ listDeals: { params: DealFilters; result: AcqDeal[] }
3683
+ getDealPipelineAnalytics: { params: { recentLimit?: number }; result: DealPipelineAnalytics }
3684
+ // Enrichment data operations
3685
+ mergeEnrichmentData: {
3686
+ params: { id: string; table: 'acq_companies' | 'acq_contacts'; data: Record<string, unknown> }
3687
+ result: void
3688
+ }
3689
+ // Social monitoring operations
3690
+ upsertSocialPosts: {
3691
+ params: { posts: Omit<UpsertSocialPostParams, 'organizationId'>[] }
3692
+ result: UpsertSocialPostsResult
3693
+ }
3694
+ setDealStateKey: {
3695
+ params: {
3696
+ dealId: string
3697
+ stateKey: string
3698
+ }
3699
+ result: { ok: true }
3700
+ }
3701
+ // CRM workflow helpers
3702
+ transitionDeal: {
3703
+ params: {
3704
+ dealId: string
3705
+ toStage: string
3706
+ toState?: string
3707
+ }
3708
+ result: { deal: AcqDeal }
3709
+ }
3710
+ loadDeal: {
3711
+ params: { dealId: string }
3712
+ result: DealDetail | null
3713
+ }
3789
3714
  }
3790
3715
  ```
3791
3716
 
3792
3717
  ### `ListToolMap`
3793
3718
 
3794
3719
  ```typescript
3795
- export type ListToolMap = {
3796
- getConfig: {
3797
- params: { listId: string }
3798
- result: { scrapingConfig: ScrapingConfig; icp: IcpRubric; pipelineConfig: PipelineConfig }
3799
- }
3800
- recordExecution: {
3801
- params: Omit<RecordListExecutionParams, 'organizationId'>
3802
- result: void
3803
- }
3804
- updateCompanyStage: {
3805
- params: Omit<UpdateCompanyStageParams, 'organizationId'>
3806
- result: void
3807
- }
3808
- updateContactStage: {
3809
- params: Omit<UpdateContactStageParams, 'organizationId'>
3810
- result: void
3811
- }
3812
- listPendingCompanyIds: {
3813
- params: Omit<ListPendingCompanyIdsParams, 'organizationId'>
3814
- result: string[]
3815
- }
3816
- listPendingContactIds: {
3817
- params: Omit<ListPendingContactIdsParams, 'organizationId'>
3818
- result: string[]
3819
- }
3720
+ export type ListToolMap = {
3721
+ getConfig: {
3722
+ params: { listId: string }
3723
+ result: { scrapingConfig: ScrapingConfig; icp: IcpRubric; pipelineConfig: PipelineConfig }
3724
+ }
3725
+ recordExecution: {
3726
+ params: Omit<RecordListExecutionParams, 'organizationId'>
3727
+ result: void
3728
+ }
3729
+ updateCompanyStage: {
3730
+ params: Omit<UpdateCompanyStageParams, 'organizationId'>
3731
+ result: void
3732
+ }
3733
+ updateContactStage: {
3734
+ params: Omit<UpdateContactStageParams, 'organizationId'>
3735
+ result: void
3736
+ }
3737
+ listPendingCompanyIds: {
3738
+ params: Omit<ListPendingCompanyIdsParams, 'organizationId'>
3739
+ result: string[]
3740
+ }
3741
+ listPendingContactIds: {
3742
+ params: Omit<ListPendingContactIdsParams, 'organizationId'>
3743
+ result: string[]
3744
+ }
3820
3745
  }
3821
3746
  ```
3822
3747