@elevasis/sdk 1.24.0 → 1.26.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 (66) hide show
  1. package/dist/cli.cjs +875 -834
  2. package/dist/index.d.ts +4857 -4547
  3. package/dist/index.js +564 -2338
  4. package/dist/node/index.d.ts +693 -1356
  5. package/dist/node/index.js +1 -1
  6. package/dist/test-utils/index.d.ts +4186 -4139
  7. package/dist/test-utils/index.js +694 -2769
  8. package/dist/types/worker/adapters/clickup.d.ts +22 -0
  9. package/dist/types/worker/adapters/index.d.ts +1 -0
  10. package/dist/types/worker/index.d.ts +3 -2
  11. package/dist/types/worker/platform.d.ts +2 -2
  12. package/dist/worker/index.js +427 -2803
  13. package/package.json +2 -2
  14. package/reference/_navigation.md +11 -1
  15. package/reference/_reference-manifest.json +70 -0
  16. package/reference/claude-config/rules/organization-model.md +12 -1
  17. package/reference/claude-config/rules/organization-os.md +12 -1
  18. package/reference/claude-config/skills/om/SKILL.md +13 -5
  19. package/reference/claude-config/skills/om/operations/codify-level-a.md +109 -100
  20. package/reference/claude-config/skills/om/operations/customers.md +10 -6
  21. package/reference/claude-config/skills/om/operations/features.md +7 -3
  22. package/reference/claude-config/skills/om/operations/goals.md +10 -6
  23. package/reference/claude-config/skills/om/operations/identity.md +8 -5
  24. package/reference/claude-config/skills/om/operations/labels.md +17 -1
  25. package/reference/claude-config/skills/om/operations/offerings.md +11 -7
  26. package/reference/claude-config/skills/om/operations/roles.md +11 -7
  27. package/reference/claude-config/skills/om/operations/techStack.md +10 -2
  28. package/reference/claude-config/sync-notes/2026-05-20-om-define-helpers.md +32 -0
  29. package/reference/claude-config/sync-notes/2026-05-22-access-model-and-right-panel.md +43 -0
  30. package/reference/claude-config/sync-notes/2026-05-22-lead-gen-tenant-config.md +40 -0
  31. package/reference/claude-config/sync-notes/2026-05-22-org-model-multi-file-split.md +61 -0
  32. package/reference/cli-management.mdx +539 -0
  33. package/reference/cli.mdx +579 -808
  34. package/reference/concepts.mdx +134 -146
  35. package/reference/deployment/api.mdx +296 -297
  36. package/reference/deployment/command-center.mdx +208 -209
  37. package/reference/deployment/index.mdx +194 -195
  38. package/reference/deployment/provided-features.mdx +110 -107
  39. package/reference/deployment/ui-execution.mdx +249 -250
  40. package/reference/framework/index.mdx +111 -195
  41. package/reference/framework/resource-documentation.mdx +90 -0
  42. package/reference/framework/tutorial-system.mdx +135 -135
  43. package/reference/getting-started.mdx +141 -142
  44. package/reference/index.mdx +95 -106
  45. package/reference/packages/ui/src/auth/README.md +6 -6
  46. package/reference/platform-tools/adapters-integration.mdx +300 -301
  47. package/reference/platform-tools/adapters-platform.mdx +552 -553
  48. package/reference/platform-tools/index.mdx +216 -217
  49. package/reference/platform-tools/type-safety.mdx +82 -82
  50. package/reference/resources/index.mdx +348 -349
  51. package/reference/resources/patterns.mdx +446 -449
  52. package/reference/resources/types.mdx +115 -116
  53. package/reference/roadmap.mdx +164 -165
  54. package/reference/rules/organization-model.md +14 -0
  55. package/reference/runtime.mdx +172 -173
  56. package/reference/scaffold/operations/propagation-pipeline.md +1 -1
  57. package/reference/scaffold/recipes/customize-crm-actions.md +45 -46
  58. package/reference/scaffold/recipes/extend-crm.md +253 -255
  59. package/reference/scaffold/recipes/extend-lead-gen.md +130 -77
  60. package/reference/scaffold/recipes/index.md +43 -44
  61. package/reference/scaffold/reference/contracts.md +1275 -1432
  62. package/reference/scaffold/reference/glossary.md +8 -6
  63. package/reference/scaffold/ui/feature-flags-and-gating.md +59 -46
  64. package/reference/scaffold/ui/feature-shell.mdx +11 -11
  65. package/reference/scaffold/ui/recipes.md +24 -24
  66. package/reference/troubleshooting.mdx +222 -223
@@ -1371,77 +1371,77 @@ export interface DeploymentSpec {
1371
1371
  ### `AcqCompany`
1372
1372
 
1373
1373
  ```typescript
1374
- /**
1375
- * Company record in the acquisition database.
1376
- * Contains enriched company data from various sources.
1377
- * Transformed from AcqCompanyRow with camelCase properties.
1378
- */
1379
- export interface AcqCompany {
1380
- id: string
1381
- organizationId: string
1382
- name: string
1383
- domain: string | null
1384
- linkedinUrl: string | null
1385
- website: string | null
1386
- numEmployees: number | null
1387
- foundedYear: number | null
1388
- locationCity: string | null
1389
- locationState: string | null
1390
- category: string | null
1391
- categoryPain: string | null
1392
- segment: string | null
1393
- processingState: CompanyProcessingState | null
1394
- /** @deprecated Use `processingState`. This legacy DB column has been removed; responses return null. */
1395
- pipelineStatus?: LegacyPipelineStatus | null
1396
- enrichmentData: CompanyEnrichmentData | null
1397
- source: string | null
1398
- batchId: string | null
1399
- status: 'active' | 'invalid'
1400
- verticalResearch: string | null
1401
- /** Track A: flat qualification score (null until a scoring rubric is defined). Added by W1 migration. */
1402
- qualificationScore: number | null
1403
- /** Track A: flat qualification signals jsonb preserving the result payload shape. Added by W1 migration. */
1404
- qualificationSignals: Record<string, unknown> | null
1405
- /** Track A: key identifying the rubric used for qualification. Added by W1 migration. */
1406
- qualificationRubricKey: string | null
1407
- createdAt: Date
1408
- updatedAt: Date
1374
+ /**
1375
+ * Company record in the acquisition database.
1376
+ * Contains enriched company data from various sources.
1377
+ * Transformed from AcqCompanyRow with camelCase properties.
1378
+ */
1379
+ export interface AcqCompany {
1380
+ id: string
1381
+ organizationId: string
1382
+ name: string
1383
+ domain: string | null
1384
+ linkedinUrl: string | null
1385
+ website: string | null
1386
+ numEmployees: number | null
1387
+ foundedYear: number | null
1388
+ locationCity: string | null
1389
+ locationState: string | null
1390
+ category: string | null
1391
+ categoryPain: string | null
1392
+ segment: string | null
1393
+ processingState: CompanyProcessingState | null
1394
+ /** @deprecated Use `processingState`. This legacy DB column has been removed; responses return null. */
1395
+ pipelineStatus?: LegacyPipelineStatus | null
1396
+ enrichmentData: CompanyEnrichmentData | null
1397
+ source: string | null
1398
+ batchId: string | null
1399
+ status: 'active' | 'invalid'
1400
+ verticalResearch: string | null
1401
+ /** Track A: flat qualification score (null until a scoring rubric is defined). Added by W1 migration. */
1402
+ qualificationScore: number | null
1403
+ /** Track A: flat qualification signals jsonb preserving the result payload shape. Added by W1 migration. */
1404
+ qualificationSignals: Record<string, unknown> | null
1405
+ /** Track A: key identifying the rubric used for qualification. Added by W1 migration. */
1406
+ qualificationRubricKey: string | null
1407
+ createdAt: Date
1408
+ updatedAt: Date
1409
1409
  }
1410
1410
  ```
1411
1411
 
1412
1412
  ### `AcqContact`
1413
1413
 
1414
1414
  ```typescript
1415
- /**
1416
- * Contact record in the acquisition database.
1417
- * Contains enriched contact data and personalization content.
1418
- * Transformed from AcqContactRow with camelCase properties.
1419
- */
1420
- export interface AcqContact {
1421
- id: string
1422
- organizationId: string
1423
- companyId: string | null
1424
- email: string
1425
- emailValid: 'VALID' | 'INVALID' | 'RISKY' | 'UNKNOWN' | null
1426
- firstName: string | null
1427
- lastName: string | null
1428
- linkedinUrl: string | null
1429
- title: string | null
1430
- headline: string | null
1431
- filterReason: string | null
1432
- openingLine: string | null
1433
- source: string | null
1434
- sourceId: string | null
1435
- processingState: ContactProcessingState | null
1436
- /** @deprecated Use `processingState`. This legacy DB column has been removed; responses return null. */
1437
- pipelineStatus?: LegacyPipelineStatus | null
1438
- enrichmentData: ContactEnrichmentData | null
1439
- /** Attio Person record ID - set when contact responds and is added to CRM */
1440
- attioPersonId: string | null
1441
- batchId: string | null
1442
- status: 'active' | 'invalid'
1443
- createdAt: Date
1444
- updatedAt: Date
1415
+ /**
1416
+ * Contact record in the acquisition database.
1417
+ * Contains enriched contact data and personalization content.
1418
+ * Transformed from AcqContactRow with camelCase properties.
1419
+ */
1420
+ export interface AcqContact {
1421
+ id: string
1422
+ organizationId: string
1423
+ companyId: string | null
1424
+ email: string
1425
+ emailValid: 'VALID' | 'INVALID' | 'RISKY' | 'UNKNOWN' | null
1426
+ firstName: string | null
1427
+ lastName: string | null
1428
+ linkedinUrl: string | null
1429
+ title: string | null
1430
+ headline: string | null
1431
+ filterReason: string | null
1432
+ openingLine: string | null
1433
+ source: string | null
1434
+ sourceId: string | null
1435
+ processingState: ContactProcessingState | null
1436
+ /** @deprecated Use `processingState`. This legacy DB column has been removed; responses return null. */
1437
+ pipelineStatus?: LegacyPipelineStatus | null
1438
+ enrichmentData: ContactEnrichmentData | null
1439
+ /** Attio Person record ID - set when contact responds and is added to CRM */
1440
+ attioPersonId: string | null
1441
+ batchId: string | null
1442
+ status: 'active' | 'invalid'
1443
+ createdAt: Date
1444
+ updatedAt: Date
1445
1445
  }
1446
1446
  ```
1447
1447
 
@@ -1460,23 +1460,23 @@ export type DealPriorityBucketKey = 'needs_response' | 'follow_up_due' | 'waitin
1460
1460
  ### `DealPriority`
1461
1461
 
1462
1462
  ```typescript
1463
- export interface DealPriority {
1464
- bucketKey: DealPriorityBucketKey
1465
- rank: number
1466
- label: string
1467
- color: string
1468
- reason: string
1469
- latestActivityAt: string | null
1470
- nextActionAt: string | null
1463
+ export interface DealPriority {
1464
+ bucketKey: DealPriorityBucketKey
1465
+ rank: number
1466
+ label: string
1467
+ color: string
1468
+ reason: string
1469
+ latestActivityAt: string | null
1470
+ nextActionAt: string | null
1471
1471
  }
1472
1472
  ```
1473
1473
 
1474
1474
  ### `KanbanStageConfig`
1475
1475
 
1476
1476
  ```typescript
1477
- export interface KanbanStageConfig {
1478
- color: string // Mantine color token (e.g. 'blue', 'teal')
1479
- label?: string // Optional display label override
1477
+ export interface KanbanStageConfig {
1478
+ color: string // Mantine color token (e.g. 'blue', 'teal')
1479
+ label?: string // Optional display label override
1480
1480
  }
1481
1481
  ```
1482
1482
 
@@ -1489,49 +1489,49 @@ export type KanbanBoardConfig = Partial<Record<DealStage, KanbanStageConfig>>
1489
1489
  ### `DealContact`
1490
1490
 
1491
1491
  ```typescript
1492
- export interface DealContact {
1493
- id: string
1494
- first_name: string | null
1495
- last_name: string | null
1496
- email: string
1497
- title: string | null
1498
- headline: string | null
1499
- linkedin_url: string | null
1500
- processing_state: Record<string, unknown> | null
1501
- enrichment_data: Record<string, unknown> | null
1502
- company: {
1503
- id: string
1504
- name: string
1505
- domain: string | null
1506
- website: string | null
1507
- linkedin_url: string | null
1508
- segment: string | null
1509
- category: string | null
1510
- num_employees: number | null
1511
- } | null
1492
+ export interface DealContact {
1493
+ id: string
1494
+ first_name: string | null
1495
+ last_name: string | null
1496
+ email: string
1497
+ title: string | null
1498
+ headline: string | null
1499
+ linkedin_url: string | null
1500
+ processing_state: Record<string, unknown> | null
1501
+ enrichment_data: Record<string, unknown> | null
1502
+ company: {
1503
+ id: string
1504
+ name: string
1505
+ domain: string | null
1506
+ website: string | null
1507
+ linkedin_url: string | null
1508
+ segment: string | null
1509
+ category: string | null
1510
+ num_employees: number | null
1511
+ } | null
1512
1512
  }
1513
1513
  ```
1514
1514
 
1515
1515
  ### `DealFilters`
1516
1516
 
1517
1517
  ```typescript
1518
- export interface DealFilters {
1519
- stage?: DealStage
1520
- search?: string
1521
- limit?: number
1522
- offset?: number
1518
+ export interface DealFilters {
1519
+ stage?: DealStage
1520
+ search?: string
1521
+ limit?: number
1522
+ offset?: number
1523
1523
  }
1524
1524
  ```
1525
1525
 
1526
1526
  ### `DealListItem`
1527
1527
 
1528
1528
  ```typescript
1529
- /** Deal list item with joined contact and company data */
1530
- export interface DealListItem extends AcqDealRow {
1531
- priority: DealPriority
1532
- ownership: 'us' | 'them' | null
1533
- nextAction: string | null
1534
- contact: DealContact | null
1529
+ /** Deal list item with joined contact and company data */
1530
+ export interface DealListItem extends AcqDealRow {
1531
+ priority: DealPriority
1532
+ ownership: 'us' | 'them' | null
1533
+ nextAction: string | null
1534
+ contact: DealContact | null
1535
1535
  }
1536
1536
  ```
1537
1537
 
@@ -1544,31 +1544,31 @@ export type DealDetail = DealListItem
1544
1544
  ### `AcqDealTaskKind`
1545
1545
 
1546
1546
  ```typescript
1547
- /** Task kind options for a deal task (human follow-up action type) */
1547
+ /** Task kind options for a deal task (human follow-up action type) */
1548
1548
  export type AcqDealTaskKind = 'call' | 'email' | 'meeting' | 'other'
1549
1549
  ```
1550
1550
 
1551
1551
  ### `AcqDealTask`
1552
1552
 
1553
1553
  ```typescript
1554
- /**
1555
- * A CRM to-do item attached to a deal representing a human follow-up action.
1556
- * Transformed from AcqDealTaskRow with camelCase properties.
1557
- */
1558
- export interface AcqDealTask {
1559
- id: string
1560
- organizationId: string
1561
- dealId: string
1562
- title: string
1563
- description: string | null
1564
- kind: AcqDealTaskKind
1565
- dueAt: string | null
1566
- assigneeUserId: string | null
1567
- completedAt: string | null
1568
- completedByUserId: string | null
1569
- createdAt: string
1570
- updatedAt: string
1571
- createdByUserId: string | null
1554
+ /**
1555
+ * A CRM to-do item attached to a deal representing a human follow-up action.
1556
+ * Transformed from AcqDealTaskRow with camelCase properties.
1557
+ */
1558
+ export interface AcqDealTask {
1559
+ id: string
1560
+ organizationId: string
1561
+ dealId: string
1562
+ title: string
1563
+ description: string | null
1564
+ kind: AcqDealTaskKind
1565
+ dueAt: string | null
1566
+ assigneeUserId: string | null
1567
+ completedAt: string | null
1568
+ completedByUserId: string | null
1569
+ createdAt: string
1570
+ updatedAt: string
1571
+ createdByUserId: string | null
1572
1572
  }
1573
1573
  ```
1574
1574
 
@@ -1581,54 +1581,24 @@ export type CrmPriorityBucketKey = 'needs_response' | 'follow_up_due' | 'waiting
1581
1581
  ### `CrmPriorityBucketDefinition`
1582
1582
 
1583
1583
  ```typescript
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
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
1591
1591
  }
1592
1592
  ```
1593
1593
 
1594
1594
  ### `CrmPriorityRuleConfig`
1595
1595
 
1596
1596
  ```typescript
1597
- export interface CrmPriorityRuleConfig {
1598
- buckets: CrmPriorityBucketDefinition[]
1599
- closedStageKeys: string[]
1600
- followUpAfterDaysByStateKey: Record<string, number>
1601
- staleAfterDays: number
1602
- }
1603
- ```
1604
-
1605
- ### `CRM_PRIORITY_BUCKETS`
1606
-
1607
- ```typescript
1608
- export const CRM_PRIORITY_BUCKETS: CrmPriorityBucketDefinition[] = [
1609
- { bucketKey: 'needs_response', label: 'Needs Response', rank: 10, color: 'red' },
1610
- { bucketKey: 'follow_up_due', label: 'Follow-up Due', rank: 20, color: 'orange' },
1611
- { bucketKey: 'waiting', label: 'Waiting', rank: 30, color: 'blue' },
1612
- { bucketKey: 'stale', label: 'Stale', rank: 40, color: 'gray' },
1613
- { bucketKey: 'closed_low', label: 'Closed', rank: 50, color: 'dark' }
1614
- ]
1615
- ```
1616
-
1617
- ### `DEFAULT_CRM_PRIORITY_RULE_CONFIG`
1618
-
1619
- ```typescript
1620
- export const DEFAULT_CRM_PRIORITY_RULE_CONFIG: CrmPriorityRuleConfig = {
1621
- buckets: CRM_PRIORITY_BUCKETS,
1622
- closedStageKeys: ['closed_won', 'closed_lost'],
1623
- followUpAfterDaysByStateKey: {
1624
- discovery_link_sent: 3,
1625
- discovery_nudging: 2,
1626
- reply_sent: 3,
1627
- followup_1_sent: 3,
1628
- followup_2_sent: 5,
1629
- followup_3_sent: 7
1630
- },
1631
- staleAfterDays: 14
1597
+ export interface CrmPriorityRuleConfig {
1598
+ buckets: CrmPriorityBucketDefinition[]
1599
+ closedStageKeys: string[]
1600
+ followUpAfterDaysByStateKey: Record<string, number>
1601
+ staleAfterDays: number
1632
1602
  }
1633
1603
  ```
1634
1604
 
@@ -1647,242 +1617,242 @@ export const AcqDealTaskKindSchema = z.enum(['call', 'email', 'meeting', 'other'
1647
1617
  ### `DealIdParamsSchema`
1648
1618
 
1649
1619
  ```typescript
1650
- export const DealIdParamsSchema = z.object({
1651
- dealId: UuidSchema
1620
+ export const DealIdParamsSchema = z.object({
1621
+ dealId: UuidSchema
1652
1622
  })
1653
1623
  ```
1654
1624
 
1655
1625
  ### `DealTaskIdParamsSchema`
1656
1626
 
1657
1627
  ```typescript
1658
- export const DealTaskIdParamsSchema = z.object({
1659
- dealId: UuidSchema,
1660
- taskId: UuidSchema
1628
+ export const DealTaskIdParamsSchema = z.object({
1629
+ dealId: UuidSchema,
1630
+ taskId: UuidSchema
1661
1631
  })
1662
1632
  ```
1663
1633
 
1664
1634
  ### `ListDealsQuerySchema`
1665
1635
 
1666
1636
  ```typescript
1667
- export const ListDealsQuerySchema = z
1668
- .object({
1669
- stage: DealStageSchema.optional(),
1670
- list: UuidSchema.optional(),
1671
- batch: z.string().trim().min(1).max(255).optional(),
1672
- staleSince: z.string().datetime().optional(),
1673
- search: z.string().optional(),
1674
- limit: z.coerce.number().int().positive().default(50),
1675
- offset: z.coerce.number().int().min(0).default(0)
1676
- })
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
+ })
1677
1647
  .strict()
1678
1648
  ```
1679
1649
 
1680
1650
  ### `DealLookupQuerySchema`
1681
1651
 
1682
1652
  ```typescript
1683
- export const DealLookupQuerySchema = z
1684
- .object({
1685
- search: z.string().trim().min(1).max(200).optional(),
1686
- limit: z.coerce.number().int().min(1).max(25).default(10)
1687
- })
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
+ })
1688
1658
  .strict()
1689
1659
  ```
1690
1660
 
1691
1661
  ### `ListDealTasksDueQuerySchema`
1692
1662
 
1693
1663
  ```typescript
1694
- export const ListDealTasksDueQuerySchema = z
1695
- .object({
1696
- window: z.enum(['overdue', 'today', 'today_and_overdue', 'upcoming']).optional(),
1697
- assigneeUserId: UuidSchema.optional()
1698
- })
1664
+ export const ListDealTasksDueQuerySchema = z
1665
+ .object({
1666
+ window: z.enum(['overdue', 'today', 'today_and_overdue', 'upcoming']).optional(),
1667
+ assigneeUserId: UuidSchema.optional()
1668
+ })
1699
1669
  .strict()
1700
1670
  ```
1701
1671
 
1702
1672
  ### `CreateDealNoteRequestSchema`
1703
1673
 
1704
1674
  ```typescript
1705
- export const CreateDealNoteRequestSchema = z
1706
- .object({
1707
- body: z.string().trim().min(1).max(10000)
1708
- })
1675
+ export const CreateDealNoteRequestSchema = z
1676
+ .object({
1677
+ body: z.string().trim().min(1).max(10000)
1678
+ })
1709
1679
  .strict()
1710
1680
  ```
1711
1681
 
1712
1682
  ### `CreateDealTaskRequestSchema`
1713
1683
 
1714
1684
  ```typescript
1715
- export const CreateDealTaskRequestSchema = z
1716
- .object({
1717
- title: z.string().trim().min(1).max(255),
1718
- description: z.string().nullable().optional(),
1719
- kind: AcqDealTaskKindSchema.optional(),
1720
- dueAt: z.string().datetime().nullable().optional(),
1721
- assigneeUserId: UuidSchema.nullable().optional()
1722
- })
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
+ })
1723
1693
  .strict()
1724
1694
  ```
1725
1695
 
1726
1696
  ### `TransitionItemRequestSchema`
1727
1697
 
1728
1698
  ```typescript
1729
- export const TransitionItemRequestSchema = z
1730
- .object({
1731
- pipelineKey: z.string().min(1),
1732
- stageKey: z.string().min(1),
1733
- stateKey: z.string().min(1).nullable().optional(),
1734
- reason: z.string().optional(),
1735
- expectedUpdatedAt: z.string().datetime().optional()
1736
- })
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
+ })
1737
1707
  .strict()
1738
1708
  ```
1739
1709
 
1740
1710
  ### `ExecuteActionParamsSchema`
1741
1711
 
1742
1712
  ```typescript
1743
- export const ExecuteActionParamsSchema = z
1744
- .object({
1745
- dealId: UuidSchema,
1746
- actionKey: NonEmptyStringSchema
1747
- })
1713
+ export const ExecuteActionParamsSchema = z
1714
+ .object({
1715
+ dealId: UuidSchema,
1716
+ actionKey: NonEmptyStringSchema
1717
+ })
1748
1718
  .strict()
1749
1719
  ```
1750
1720
 
1751
1721
  ### `ExecuteActionRequestSchema`
1752
1722
 
1753
1723
  ```typescript
1754
- export const ExecuteActionRequestSchema = z
1755
- .object({
1756
- payload: z.record(z.string(), z.unknown()).optional()
1757
- })
1724
+ export const ExecuteActionRequestSchema = z
1725
+ .object({
1726
+ payload: z.record(z.string(), z.unknown()).optional()
1727
+ })
1758
1728
  .strict()
1759
1729
  ```
1760
1730
 
1761
1731
  ### `DealContactSummarySchema`
1762
1732
 
1763
1733
  ```typescript
1764
- /**
1765
- * Contact summary nested inside DealListItem / DealDetailResponse.
1766
- * Matches the joined shape returned by useDeals / useDealDetail Supabase queries.
1767
- */
1768
- export const DealContactSummarySchema = z.object({
1769
- id: z.string(),
1770
- first_name: z.string().nullable(),
1771
- last_name: z.string().nullable(),
1772
- email: z.string(),
1773
- title: z.string().nullable(),
1774
- headline: z.string().nullable(),
1775
- linkedin_url: z.string().nullable(),
1776
- processing_state: ProcessingStateSchema.nullable(),
1777
- enrichment_data: z.record(z.string(), z.unknown()).nullable(),
1778
- company: z
1779
- .object({
1780
- id: z.string(),
1781
- name: z.string(),
1782
- domain: z.string().nullable(),
1783
- website: z.string().nullable(),
1784
- linkedin_url: z.string().nullable(),
1785
- segment: z.string().nullable(),
1786
- category: z.string().nullable(),
1787
- num_employees: z.number().nullable()
1788
- })
1789
- .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()
1790
1760
  })
1791
1761
  ```
1792
1762
 
1793
1763
  ### `DealPrioritySchema`
1794
1764
 
1795
1765
  ```typescript
1796
- export const DealPrioritySchema = z.object({
1797
- bucketKey: z.enum(['needs_response', 'follow_up_due', 'waiting', 'stale', 'closed_low']),
1798
- rank: z.number().int(),
1799
- label: z.string(),
1800
- color: z.string(),
1801
- reason: z.string(),
1802
- latestActivityAt: z.string().nullable(),
1803
- 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()
1804
1774
  })
1805
1775
  ```
1806
1776
 
1807
1777
  ### `DealListItemSchema`
1808
1778
 
1809
1779
  ```typescript
1810
- /**
1811
- * Deal list item with joined contact (and company via contact).
1812
- * Matches DealListItem from @repo/core types.
1813
- */
1814
- export const DealListItemSchema = z.object({
1815
- // acq_deals columns
1816
- id: z.string(),
1817
- organization_id: z.string(),
1818
- client_id: z.string().nullable().optional(),
1819
- contact_id: z.string().nullable(),
1820
- contact_email: z.string(),
1821
- pipeline_key: z.string(),
1822
- stage_key: z.string().nullable(),
1823
- state_key: z.string().nullable(),
1824
- activity_log: z.unknown(),
1825
- discovery_data: z.unknown().nullable(),
1826
- discovery_submitted_at: z.string().nullable(),
1827
- discovery_submitted_by: z.string().nullable(),
1828
- proposal_data: z.unknown().nullable(),
1829
- proposal_sent_at: z.string().nullable(),
1830
- proposal_pdf_url: z.string().nullable(),
1831
- signature_envelope_id: z.string().nullable(),
1832
- source_list_id: z.string().nullable(),
1833
- source_type: z.string().nullable(),
1834
- initial_fee: z.number().nullable(),
1835
- monthly_fee: z.number().nullable(),
1836
- closed_lost_at: z.string().nullable(),
1837
- closed_lost_reason: z.string().nullable(),
1838
- created_at: z.string(),
1839
- updated_at: z.string(),
1840
- priority: DealPrioritySchema,
1841
- ownership: z.enum(['us', 'them']).nullable(),
1842
- nextAction: z.string().nullable(),
1843
- // joined relation
1844
- 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()
1845
1815
  })
1846
1816
  ```
1847
1817
 
1848
1818
  ### `DealListResponseSchema`
1849
1819
 
1850
1820
  ```typescript
1851
- export const DealListResponseSchema = z.object({
1852
- data: z.array(DealListItemSchema),
1853
- total: z.number().int(),
1854
- limit: z.number().int(),
1855
- 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()
1856
1826
  })
1857
1827
  ```
1858
1828
 
1859
1829
  ### `DealDetailResponseSchema`
1860
1830
 
1861
1831
  ```typescript
1862
- /**
1863
- * Deal detail shape — currently the same as a list item (full joined record).
1864
- * Additive fields keep existing DealListItem callers compatible.
1865
- */
1866
- export const DealDetailResponseSchema = DealListItemSchema.extend({
1867
- conversation: DealConversationSchema,
1868
- 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()
1869
1839
  })
1870
1840
  ```
1871
1841
 
1872
1842
  ### `DealNoteResponseSchema`
1873
1843
 
1874
1844
  ```typescript
1875
- /**
1876
- * Single acq_deal_notes row (camelCase API representation).
1877
- */
1878
- export const DealNoteResponseSchema = z.object({
1879
- id: z.string(),
1880
- dealId: z.string(),
1881
- organizationId: z.string(),
1882
- authorUserId: z.string().nullable(),
1883
- body: z.string(),
1884
- createdAt: z.string(),
1885
- 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()
1886
1856
  })
1887
1857
  ```
1888
1858
 
@@ -1895,24 +1865,24 @@ export const DealNoteListResponseSchema = z.array(DealNoteResponseSchema)
1895
1865
  ### `DealTaskResponseSchema`
1896
1866
 
1897
1867
  ```typescript
1898
- /**
1899
- * Single acq_deal_tasks row (camelCase API representation).
1900
- * Matches AcqDealTask domain type from types.ts.
1901
- */
1902
- export const DealTaskResponseSchema = z.object({
1903
- id: z.string(),
1904
- organizationId: z.string(),
1905
- dealId: z.string(),
1906
- title: z.string(),
1907
- description: z.string().nullable(),
1908
- kind: AcqDealTaskKindSchema,
1909
- dueAt: z.string().nullable(),
1910
- assigneeUserId: z.string().nullable(),
1911
- completedAt: z.string().nullable(),
1912
- completedByUserId: z.string().nullable(),
1913
- createdAt: z.string(),
1914
- updatedAt: z.string(),
1915
- 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()
1916
1886
  })
1917
1887
  ```
1918
1888
 
@@ -1925,44 +1895,44 @@ export const DealTaskListResponseSchema = z.array(DealTaskResponseSchema)
1925
1895
  ### `DealSchemas`
1926
1896
 
1927
1897
  ```typescript
1928
- export const DealSchemas = {
1929
- // Primitives
1930
- CrmStageKey: CrmStageKeySchema,
1931
- CrmStateKey: CrmStateKeySchema,
1932
- DealStage: DealStageSchema,
1933
-
1934
- // Params
1935
- DealIdParams: DealIdParamsSchema,
1936
- DealTaskIdParams: DealTaskIdParamsSchema,
1937
-
1938
- // Queries
1939
- ListDealsQuery: ListDealsQuerySchema,
1940
- DealLookupQuery: DealLookupQuerySchema,
1941
- ListDealTasksDueQuery: ListDealTasksDueQuerySchema,
1942
-
1943
- // Request bodies
1944
- CreateDealNoteRequest: CreateDealNoteRequestSchema,
1945
- CreateDealTaskRequest: CreateDealTaskRequestSchema,
1946
- TransitionItemRequest: CrmTransitionItemRequestSchema,
1947
- TransitionDealStateRequest: TransitionDealStateRequestSchema,
1948
- ExecuteActionParams: ExecuteActionParamsSchema,
1949
- ExecuteActionRequest: ExecuteActionRequestSchema,
1950
-
1951
- // Responses
1952
- DealPriority: DealPrioritySchema,
1953
- DealListResponse: DealListResponseSchema,
1954
- DealSummaryResponse: DealSummaryResponseSchema,
1955
- DealLookupResponse: DealLookupResponseSchema,
1956
- ConversationMessage: ConversationMessageSchema,
1957
- DealLineageListRef: DealLineageListRefSchema,
1958
- DealLineageProjectRef: DealLineageProjectRefSchema,
1959
- DealLineageClientRef: DealLineageClientRefSchema,
1960
- DealLineage: DealLineageSchema,
1961
- DealDetailResponse: DealDetailResponseSchema,
1962
- DealNoteResponse: DealNoteResponseSchema,
1963
- DealNoteListResponse: DealNoteListResponseSchema,
1964
- DealTaskResponse: DealTaskResponseSchema,
1965
- 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
1966
1936
  }
1967
1937
  ```
1968
1938
 
@@ -1988,79 +1958,22 @@ export interface ActionDef {
1988
1958
  }
1989
1959
  ```
1990
1960
 
1991
- ### `DEFAULT_CRM_ACTIONS`
1992
-
1993
- ```typescript
1994
- export const DEFAULT_CRM_ACTIONS: ActionDef[] = [
1995
- crmAction('move_to_proposal', {
1996
- isAvailableFor: (deal) => deal.stage_key === 'interested'
1997
- }),
1998
- crmAction('move_to_closing', {
1999
- isAvailableFor: (deal) => deal.stage_key === 'proposal'
2000
- }),
2001
- crmAction('move_to_closed_won', {
2002
- isAvailableFor: (deal) => deal.stage_key === 'closing'
2003
- }),
2004
- crmAction('move_to_closed_lost', {
2005
- isAvailableFor: (deal) =>
2006
- deal.stage_key === 'interested' || deal.stage_key === 'proposal' || deal.stage_key === 'closing'
2007
- }),
2008
- crmAction('move_to_nurturing', {
2009
- isAvailableFor: (deal) =>
2010
- deal.stage_key === 'interested' || deal.stage_key === 'proposal' || deal.stage_key === 'closing'
2011
- }),
2012
- crmAction('send_reply', {
2013
- isAvailableFor: (deal) =>
2014
- deal.stage_key === 'interested' &&
2015
- isOurReplyAction(deal) &&
2016
- (deal.state_key === CRM_DISCOVERY_REPLIED_STATE.stateKey ||
2017
- deal.state_key === CRM_DISCOVERY_LINK_SENT_STATE.stateKey ||
2018
- deal.state_key === CRM_DISCOVERY_NUDGING_STATE.stateKey),
2019
- payloadSchema: SendReplyActionPayloadSchema
2020
- }),
2021
- crmAction('send_link', {
2022
- isAvailableFor: (deal) =>
2023
- deal.stage_key === 'interested' && deal.state_key === CRM_DISCOVERY_REPLIED_STATE.stateKey
2024
- }),
2025
- crmAction('send_nudge', {
2026
- isAvailableFor: (deal) =>
2027
- deal.stage_key === 'interested' &&
2028
- (deal.state_key === CRM_DISCOVERY_LINK_SENT_STATE.stateKey ||
2029
- deal.state_key === CRM_DISCOVERY_NUDGING_STATE.stateKey)
2030
- }),
2031
- {
2032
- key: 'mark_no_show',
2033
- label: 'Mark No-Show',
2034
- isAvailableFor: (deal) =>
2035
- deal.stage_key === 'interested' && deal.state_key === CRM_DISCOVERY_NUDGING_STATE.stateKey,
2036
- // Mirrors the auto-timeout precedent in operations/sales/crm/pipeline/timeout-actions.ts:
2037
- // both manual-click and timeout move the deal to closed_lost. The action_taken activity
2038
- // event captures operator intent and distinguishes the manual variant from the timed one.
2039
- workflowId: 'mark_no_show-workflow'
2040
- },
2041
- crmAction('rebook', {
2042
- isAvailableFor: (deal) =>
2043
- deal.stage_key === 'interested' && deal.state_key === CRM_DISCOVERY_BOOKING_CANCELLED_STATE.stateKey
2044
- })
2045
- ]
2046
- ```
2047
-
2048
1961
  ### `CrmToolMap`
2049
1962
 
2050
1963
  ```typescript
2051
- export type CrmToolMap = {
2052
- getRecentActivity: { params: CrmRecentActivityParams; result: RecentActivityEntry[] }
2053
- listDeals: { params: CrmListDealsParams; result: DealListItem[] }
2054
- getDeal: { params: CrmGetDealParams; result: DealDetail | null }
2055
- getDealByEmail: { params: CrmGetDealByEmailParams; result: DealDetail | null }
2056
- createDealNote: { params: CrmDealNoteParams; result: AcqDealNote }
2057
- listDealNotes: { params: Omit<ListDealNotesParams, 'organizationId'>; result: AcqDealNote[] }
2058
- createDealTask: { params: CrmDealTaskParams; result: AcqDealTask }
2059
- listDealTasks: { params: Omit<ListDealTasksParams, 'organizationId'>; result: AcqDealTask[] }
2060
- listDealTasksDue: { params: CrmTaskDueParams; result: AcqDealTask[] }
2061
- completeDealTask: { params: Omit<CompleteDealTaskParams, 'organizationId'>; result: AcqDealTask }
2062
- recordActivity: { params: CrmRecordActivityParams; result: void }
2063
- 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 }
2064
1977
  }
2065
1978
  ```
2066
1979
 
@@ -2069,402 +1982,402 @@ export type CrmToolMap = {
2069
1982
  ### `WebPost`
2070
1983
 
2071
1984
  ```typescript
2072
- /**
2073
- * Represents a web post from company website scraping.
2074
- * Used for recent blog posts, news, or announcements.
2075
- */
2076
- export interface WebPost {
2077
- /** ISO date string of when the post was published */
2078
- date: string
2079
- /** Title of the web post */
2080
- title: string
2081
- /** Brief summary of the post content */
2082
- summary: string
2083
- /** AI-generated insight about the post's relevance */
2084
- aiInsight?: string
1985
+ /**
1986
+ * Represents a web post from company website scraping.
1987
+ * Used for recent blog posts, news, or announcements.
1988
+ */
1989
+ export interface WebPost {
1990
+ /** ISO date string of when the post was published */
1991
+ date: string
1992
+ /** Title of the web post */
1993
+ title: string
1994
+ /** Brief summary of the post content */
1995
+ summary: string
1996
+ /** AI-generated insight about the post's relevance */
1997
+ aiInsight?: string
2085
1998
  }
2086
1999
  ```
2087
2000
 
2088
2001
  ### `CompanyEnrichmentData`
2089
2002
 
2090
2003
  ```typescript
2091
- /**
2092
- * Enrichment data collected for a company from various sources.
2093
- */
2094
- export interface CompanyEnrichmentData {
2095
- googleMaps?: {
2096
- placeId?: string
2097
- totalScore?: number
2098
- reviewsCount?: number
2099
- address?: string
2100
- phone?: string
2101
- categoryName?: string
2102
- googleMapsUrl?: string
2103
- scrapedAt?: string
2104
- }
2105
- websiteCrawl?: {
2106
- companyDescription?: string
2107
- services?: string[]
2108
- specialties?: string[]
2109
- staff?: Array<{ name: string; title?: string; email?: string }>
2110
- automationGaps?: string[]
2111
- targetAudience?: string
2112
- category?: string
2113
- segment?: string
2114
- recentWin?: string
2115
- emailCount?: number
2116
- pageCount?: number
2117
- totalChars?: number
2118
- crawledAt?: string
2119
- extractedAt?: string
2120
- }
2121
- website?: {
2122
- missionVision?: string
2123
- uniqueAttributes?: string
2124
- coreOfferings?: string
2125
- targetAudience?: string
2126
- companyValues?: string
2127
- businessDescription?: string
2128
- recentPosts?: Array<{ date?: string; title?: string; summary?: string; aiInsight?: string }>
2129
- }
2130
- tomba?: {
2131
- waterfallEmail?: {
2132
- email: string
2133
- name?: string
2134
- title?: string
2135
- department?: string
2136
- } | null
2137
- genericEmail?: string | null
2138
- totalFound?: number
2139
- searchedAt?: string
2140
- }
2004
+ /**
2005
+ * Enrichment data collected for a company from various sources.
2006
+ */
2007
+ export interface CompanyEnrichmentData {
2008
+ googleMaps?: {
2009
+ placeId?: string
2010
+ totalScore?: number
2011
+ reviewsCount?: number
2012
+ address?: string
2013
+ phone?: string
2014
+ categoryName?: string
2015
+ googleMapsUrl?: string
2016
+ scrapedAt?: string
2017
+ }
2018
+ websiteCrawl?: {
2019
+ companyDescription?: string
2020
+ services?: string[]
2021
+ specialties?: string[]
2022
+ staff?: Array<{ name: string; title?: string; email?: string }>
2023
+ automationGaps?: string[]
2024
+ targetAudience?: string
2025
+ category?: string
2026
+ segment?: string
2027
+ recentWin?: string
2028
+ emailCount?: number
2029
+ pageCount?: number
2030
+ totalChars?: number
2031
+ crawledAt?: string
2032
+ extractedAt?: string
2033
+ }
2034
+ website?: {
2035
+ missionVision?: string
2036
+ uniqueAttributes?: string
2037
+ coreOfferings?: string
2038
+ targetAudience?: string
2039
+ companyValues?: string
2040
+ businessDescription?: string
2041
+ recentPosts?: Array<{ date?: string; title?: string; summary?: string; aiInsight?: string }>
2042
+ }
2043
+ tomba?: {
2044
+ waterfallEmail?: {
2045
+ email: string
2046
+ name?: string
2047
+ title?: string
2048
+ department?: string
2049
+ } | null
2050
+ genericEmail?: string | null
2051
+ totalFound?: number
2052
+ searchedAt?: string
2053
+ }
2141
2054
  }
2142
2055
  ```
2143
2056
 
2144
2057
  ### `ContactEnrichmentData`
2145
2058
 
2146
2059
  ```typescript
2147
- /**
2148
- * Enrichment data collected for a contact from various sources.
2149
- */
2150
- export interface ContactEnrichmentData {
2151
- linkedin?: {
2152
- summary?: string
2153
- pastExperience?: string
2154
- education?: string
2155
- activity?: Array<{ date?: string; content?: string }>
2156
- }
2060
+ /**
2061
+ * Enrichment data collected for a contact from various sources.
2062
+ */
2063
+ export interface ContactEnrichmentData {
2064
+ linkedin?: {
2065
+ summary?: string
2066
+ pastExperience?: string
2067
+ education?: string
2068
+ activity?: Array<{ date?: string; content?: string }>
2069
+ }
2157
2070
  }
2158
2071
  ```
2159
2072
 
2160
2073
  ### `AcqList`
2161
2074
 
2162
2075
  ```typescript
2163
- export interface AcqList {
2164
- id: string
2165
- organizationId: string
2166
- name: string
2167
- description: string | null
2168
- batchIds: string[]
2169
- instantlyCampaignId: string | null
2170
- status: ListStatus
2171
- scrapingConfig: ScrapingConfig
2172
- icp: IcpRubric
2173
- pipelineConfig: PipelineConfig
2174
- metadata: AcqListMetadata
2175
- launchedAt: Date | null
2176
- completedAt: Date | null
2177
- createdAt: Date
2076
+ export interface AcqList {
2077
+ id: string
2078
+ organizationId: string
2079
+ name: string
2080
+ description: string | null
2081
+ batchIds: string[]
2082
+ instantlyCampaignId: string | null
2083
+ status: ListStatus
2084
+ scrapingConfig: ScrapingConfig
2085
+ icp: IcpRubric
2086
+ pipelineConfig: PipelineConfig
2087
+ metadata: AcqListMetadata
2088
+ launchedAt: Date | null
2089
+ completedAt: Date | null
2090
+ createdAt: Date
2178
2091
  }
2179
2092
  ```
2180
2093
 
2181
2094
  ### `AcqCompany`
2182
2095
 
2183
2096
  ```typescript
2184
- /**
2185
- * Company record in the acquisition database.
2186
- * Contains enriched company data from various sources.
2187
- * Transformed from AcqCompanyRow with camelCase properties.
2188
- */
2189
- export interface AcqCompany {
2190
- id: string
2191
- organizationId: string
2192
- name: string
2193
- domain: string | null
2194
- linkedinUrl: string | null
2195
- website: string | null
2196
- numEmployees: number | null
2197
- foundedYear: number | null
2198
- locationCity: string | null
2199
- locationState: string | null
2200
- category: string | null
2201
- categoryPain: string | null
2202
- segment: string | null
2203
- processingState: CompanyProcessingState | null
2204
- /** @deprecated Use `processingState`. This legacy DB column has been removed; responses return null. */
2205
- pipelineStatus?: LegacyPipelineStatus | null
2206
- enrichmentData: CompanyEnrichmentData | null
2207
- source: string | null
2208
- batchId: string | null
2209
- status: 'active' | 'invalid'
2210
- verticalResearch: string | null
2211
- /** Track A: flat qualification score (null until a scoring rubric is defined). Added by W1 migration. */
2212
- qualificationScore: number | null
2213
- /** Track A: flat qualification signals jsonb preserving the result payload shape. Added by W1 migration. */
2214
- qualificationSignals: Record<string, unknown> | null
2215
- /** Track A: key identifying the rubric used for qualification. Added by W1 migration. */
2216
- qualificationRubricKey: string | null
2217
- createdAt: Date
2218
- updatedAt: Date
2097
+ /**
2098
+ * Company record in the acquisition database.
2099
+ * Contains enriched company data from various sources.
2100
+ * Transformed from AcqCompanyRow with camelCase properties.
2101
+ */
2102
+ export interface AcqCompany {
2103
+ id: string
2104
+ organizationId: string
2105
+ name: string
2106
+ domain: string | null
2107
+ linkedinUrl: string | null
2108
+ website: string | null
2109
+ numEmployees: number | null
2110
+ foundedYear: number | null
2111
+ locationCity: string | null
2112
+ locationState: string | null
2113
+ category: string | null
2114
+ categoryPain: string | null
2115
+ segment: string | null
2116
+ processingState: CompanyProcessingState | null
2117
+ /** @deprecated Use `processingState`. This legacy DB column has been removed; responses return null. */
2118
+ pipelineStatus?: LegacyPipelineStatus | null
2119
+ enrichmentData: CompanyEnrichmentData | null
2120
+ source: string | null
2121
+ batchId: string | null
2122
+ status: 'active' | 'invalid'
2123
+ verticalResearch: string | null
2124
+ /** Track A: flat qualification score (null until a scoring rubric is defined). Added by W1 migration. */
2125
+ qualificationScore: number | null
2126
+ /** Track A: flat qualification signals jsonb preserving the result payload shape. Added by W1 migration. */
2127
+ qualificationSignals: Record<string, unknown> | null
2128
+ /** Track A: key identifying the rubric used for qualification. Added by W1 migration. */
2129
+ qualificationRubricKey: string | null
2130
+ createdAt: Date
2131
+ updatedAt: Date
2219
2132
  }
2220
2133
  ```
2221
2134
 
2222
2135
  ### `AcqContact`
2223
2136
 
2224
2137
  ```typescript
2225
- /**
2226
- * Contact record in the acquisition database.
2227
- * Contains enriched contact data and personalization content.
2228
- * Transformed from AcqContactRow with camelCase properties.
2229
- */
2230
- export interface AcqContact {
2231
- id: string
2232
- organizationId: string
2233
- companyId: string | null
2234
- email: string
2235
- emailValid: 'VALID' | 'INVALID' | 'RISKY' | 'UNKNOWN' | null
2236
- firstName: string | null
2237
- lastName: string | null
2238
- linkedinUrl: string | null
2239
- title: string | null
2240
- headline: string | null
2241
- filterReason: string | null
2242
- openingLine: string | null
2243
- source: string | null
2244
- sourceId: string | null
2245
- processingState: ContactProcessingState | null
2246
- /** @deprecated Use `processingState`. This legacy DB column has been removed; responses return null. */
2247
- pipelineStatus?: LegacyPipelineStatus | null
2248
- enrichmentData: ContactEnrichmentData | null
2249
- /** Attio Person record ID - set when contact responds and is added to CRM */
2250
- attioPersonId: string | null
2251
- batchId: string | null
2252
- status: 'active' | 'invalid'
2253
- createdAt: Date
2254
- updatedAt: Date
2138
+ /**
2139
+ * Contact record in the acquisition database.
2140
+ * Contains enriched contact data and personalization content.
2141
+ * Transformed from AcqContactRow with camelCase properties.
2142
+ */
2143
+ export interface AcqContact {
2144
+ id: string
2145
+ organizationId: string
2146
+ companyId: string | null
2147
+ email: string
2148
+ emailValid: 'VALID' | 'INVALID' | 'RISKY' | 'UNKNOWN' | null
2149
+ firstName: string | null
2150
+ lastName: string | null
2151
+ linkedinUrl: string | null
2152
+ title: string | null
2153
+ headline: string | null
2154
+ filterReason: string | null
2155
+ openingLine: string | null
2156
+ source: string | null
2157
+ sourceId: string | null
2158
+ processingState: ContactProcessingState | null
2159
+ /** @deprecated Use `processingState`. This legacy DB column has been removed; responses return null. */
2160
+ pipelineStatus?: LegacyPipelineStatus | null
2161
+ enrichmentData: ContactEnrichmentData | null
2162
+ /** Attio Person record ID - set when contact responds and is added to CRM */
2163
+ attioPersonId: string | null
2164
+ batchId: string | null
2165
+ status: 'active' | 'invalid'
2166
+ createdAt: Date
2167
+ updatedAt: Date
2255
2168
  }
2256
2169
  ```
2257
2170
 
2258
2171
  ### `ListTelemetry`
2259
2172
 
2260
2173
  ```typescript
2261
- /**
2262
- * Live-scan aggregate telemetry for a single list, computed on demand from
2263
- * the list junction tables and current contact deliverability state.
2264
- * `stageCounts` are attempted counts from list-row processing_state.
2265
- */
2266
- export interface ListTelemetry {
2267
- listId: string
2268
- totalCompanies: number
2269
- totalContacts: number
2270
- stageCounts: {
2271
- populated: number
2272
- extracted: number
2273
- qualified: number
2274
- discovered: number
2275
- verified: number
2276
- personalized: number
2277
- uploaded: number
2278
- }
2279
- deliverability: {
2280
- valid: number
2281
- risky: number
2282
- invalid: number
2283
- unknown: number
2284
- bounced: number
2285
- }
2286
- /** Reserved -- active workflow IDs associated with this list. */
2287
- activeWorkflows?: string[]
2174
+ /**
2175
+ * Live-scan aggregate telemetry for a single list, computed on demand from
2176
+ * the list junction tables and current contact deliverability state.
2177
+ * `stageCounts` are attempted counts from list-row processing_state.
2178
+ */
2179
+ export interface ListTelemetry {
2180
+ listId: string
2181
+ totalCompanies: number
2182
+ totalContacts: number
2183
+ stageCounts: {
2184
+ populated: number
2185
+ extracted: number
2186
+ qualified: number
2187
+ discovered: number
2188
+ verified: number
2189
+ personalized: number
2190
+ uploaded: number
2191
+ }
2192
+ deliverability: {
2193
+ valid: number
2194
+ risky: number
2195
+ invalid: number
2196
+ unknown: number
2197
+ bounced: number
2198
+ }
2199
+ /** Reserved -- active workflow IDs associated with this list. */
2200
+ activeWorkflows?: string[]
2288
2201
  }
2289
2202
  ```
2290
2203
 
2291
2204
  ### `ListStageCountsSchema`
2292
2205
 
2293
2206
  ```typescript
2294
- export const ListStageCountsSchema = z.object({
2295
- // Attempted counts by canonical lead-gen stage. The detailed status
2296
- // distribution lives on ListProgress; telemetry keeps the overview payload small.
2297
- stageCounts: z.object({
2298
- populated: z.number().int(),
2299
- extracted: z.number().int(),
2300
- qualified: z.number().int(),
2301
- discovered: z.number().int(),
2302
- verified: z.number().int(),
2303
- personalized: z.number().int(),
2304
- uploaded: z.number().int()
2305
- }),
2306
- deliverability: z.object({
2307
- valid: z.number().int(),
2308
- risky: z.number().int(),
2309
- invalid: z.number().int(),
2310
- unknown: z.number().int(),
2311
- bounced: z.number().int()
2312
- })
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
+ })
2313
2226
  })
2314
2227
  ```
2315
2228
 
2316
2229
  ### `ListTelemetrySchema`
2317
2230
 
2318
2231
  ```typescript
2319
- export const ListTelemetrySchema = z.object({
2320
- listId: UuidSchema,
2321
- totalCompanies: z.number().int(),
2322
- totalContacts: z.number().int(),
2323
- stageCounts: ListStageCountsSchema.shape.stageCounts,
2324
- deliverability: ListStageCountsSchema.shape.deliverability,
2325
- 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()
2326
2239
  })
2327
2240
  ```
2328
2241
 
2329
2242
  ### `ListIdParamsSchema`
2330
2243
 
2331
2244
  ```typescript
2332
- export const ListIdParamsSchema = z.object({
2333
- listId: UuidSchema
2245
+ export const ListIdParamsSchema = z.object({
2246
+ listId: UuidSchema
2334
2247
  })
2335
2248
  ```
2336
2249
 
2337
2250
  ### `CreateListRequestSchema`
2338
2251
 
2339
2252
  ```typescript
2340
- export const CreateListRequestSchema = z
2341
- .object({
2342
- name: z.string().trim().min(1).max(255),
2343
- description: z.string().trim().nullable().optional(),
2344
- status: ListStatusSchema.optional(),
2345
- buildTemplateId: ProspectingBuildTemplateIdSchema.optional(),
2346
- scrapingConfig: ScrapingConfigSchema.optional(),
2347
- icp: IcpRubricSchema.optional(),
2348
- pipelineConfig: PipelineConfigSchema.optional()
2349
- })
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
+ })
2350
2263
  .strict()
2351
2264
  ```
2352
2265
 
2353
2266
  ### `UpdateListRequestSchema`
2354
2267
 
2355
2268
  ```typescript
2356
- export const UpdateListRequestSchema = z
2357
- .object({
2358
- name: z.string().trim().min(1).max(255).optional(),
2359
- description: z.string().trim().nullable().optional(),
2360
- batchIds: z.array(z.string()).optional(),
2361
- buildTemplateId: ProspectingBuildTemplateIdSchema.optional(),
2362
- confirmBuildTemplateChange: z.literal(true).optional()
2363
- })
2364
- .strict()
2365
- .refine(
2366
- (data) =>
2367
- data.name !== undefined ||
2368
- data.description !== undefined ||
2369
- data.batchIds !== undefined ||
2370
- data.buildTemplateId !== undefined,
2371
- {
2372
- message: 'At least one field (name, description, batchIds, or buildTemplateId) must be provided'
2373
- }
2374
- )
2375
- .refine((data) => data.buildTemplateId === undefined || data.confirmBuildTemplateChange === true, {
2376
- message: 'confirmBuildTemplateChange must be true when changing buildTemplateId',
2377
- 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']
2378
2291
  })
2379
2292
  ```
2380
2293
 
2381
2294
  ### `UpdateListConfigRequestSchema`
2382
2295
 
2383
2296
  ```typescript
2384
- /**
2385
- * Partial patch for the three jsonb config columns. UI sends only the edited
2386
- * subtree; server writes the field as-is (no deep merge — each column is
2387
- * replaced atomically when present in the patch).
2388
- */
2389
- export const UpdateListConfigRequestSchema = z
2390
- .object({
2391
- scrapingConfig: ScrapingConfigSchema.partial().optional(),
2392
- icp: IcpRubricSchema.partial().optional(),
2393
- pipelineConfig: PipelineConfigSchema.partial().optional()
2394
- })
2395
- .strict()
2396
- .refine((data) => data.scrapingConfig !== undefined || data.icp !== undefined || data.pipelineConfig !== undefined, {
2397
- 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'
2398
2311
  })
2399
2312
  ```
2400
2313
 
2401
2314
  ### `AddCompaniesToListRequestSchema`
2402
2315
 
2403
2316
  ```typescript
2404
- export const AddCompaniesToListRequestSchema = z
2405
- .object({
2406
- companyIds: z.array(UuidSchema).min(1).max(1000)
2407
- })
2317
+ export const AddCompaniesToListRequestSchema = z
2318
+ .object({
2319
+ companyIds: z.array(UuidSchema).min(1).max(1000)
2320
+ })
2408
2321
  .strict()
2409
2322
  ```
2410
2323
 
2411
2324
  ### `RemoveCompaniesFromListRequestSchema`
2412
2325
 
2413
2326
  ```typescript
2414
- export const RemoveCompaniesFromListRequestSchema = z
2415
- .object({
2416
- companyIds: z.array(UuidSchema).min(1).max(1000)
2417
- })
2327
+ export const RemoveCompaniesFromListRequestSchema = z
2328
+ .object({
2329
+ companyIds: z.array(UuidSchema).min(1).max(1000)
2330
+ })
2418
2331
  .strict()
2419
2332
  ```
2420
2333
 
2421
2334
  ### `AddContactsToListRequestSchema`
2422
2335
 
2423
2336
  ```typescript
2424
- export const AddContactsToListRequestSchema = z
2425
- .object({
2426
- contactIds: z.array(UuidSchema).min(1).max(1000)
2427
- })
2337
+ export const AddContactsToListRequestSchema = z
2338
+ .object({
2339
+ contactIds: z.array(UuidSchema).min(1).max(1000)
2340
+ })
2428
2341
  .strict()
2429
2342
  ```
2430
2343
 
2431
2344
  ### `RecordListExecutionRequestSchema`
2432
2345
 
2433
2346
  ```typescript
2434
- export const RecordListExecutionRequestSchema = z
2435
- .object({
2436
- executionId: UuidSchema,
2437
- configSnapshot: z.record(z.string(), z.unknown()).optional()
2438
- })
2347
+ export const RecordListExecutionRequestSchema = z
2348
+ .object({
2349
+ executionId: UuidSchema,
2350
+ configSnapshot: z.record(z.string(), z.unknown()).optional()
2351
+ })
2439
2352
  .strict()
2440
2353
  ```
2441
2354
 
2442
2355
  ### `AcqListResponseSchema`
2443
2356
 
2444
2357
  ```typescript
2445
- /**
2446
- * Single list as returned by /api/acquisition/lists/:id etc.
2447
- * Camel-cased domain shape matching AcqList in types.ts.
2448
- */
2449
- export const AcqListResponseSchema = z.object({
2450
- id: z.string(),
2451
- organizationId: z.string(),
2452
- name: z.string(),
2453
- description: z.string().nullable(),
2454
- batchIds: z.array(z.string()),
2455
- instantlyCampaignId: z.string().nullable(),
2456
- /** Lifecycle status (draft | enriching | launched | closing | archived). */
2457
- status: ListStatusSchema,
2458
- metadata: AcqListMetadataSchema,
2459
- launchedAt: z.string().nullable(),
2460
- completedAt: z.string().nullable(),
2461
- createdAt: z.string(),
2462
- /** Scraping criteria stored as jsonb on the row. */
2463
- scrapingConfig: ScrapingConfigSchema,
2464
- /** ICP / qualification rubric stored as jsonb on the row. */
2465
- icp: IcpRubricSchema,
2466
- /** Pipeline presentation contract stored as jsonb on the row. */
2467
- 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
2468
2381
  })
2469
2382
  ```
2470
2383
 
@@ -2489,18 +2402,18 @@ export const ListTelemetryListResponseSchema = z.array(ListTelemetrySchema)
2489
2402
  ### `ListExecutionSummarySchema`
2490
2403
 
2491
2404
  ```typescript
2492
- /**
2493
- * Row from acq_list_executions joined with the execution summary,
2494
- * shaped for the /lists/:id/executions response.
2495
- */
2496
- export const ListExecutionSummarySchema = z.object({
2497
- executionId: z.string(),
2498
- resourceId: z.string(),
2499
- status: z.string(),
2500
- createdAt: z.string(),
2501
- completedAt: z.string().nullable(),
2502
- durationMs: z.number().int().nullable(),
2503
- 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()
2504
2417
  })
2505
2418
  ```
2506
2419
 
@@ -2531,299 +2444,299 @@ export const AcqEmailValidSchema = z.enum(['VALID', 'INVALID', 'RISKY', 'UNKNOWN
2531
2444
  ### `CompanyIdParamsSchema`
2532
2445
 
2533
2446
  ```typescript
2534
- export const CompanyIdParamsSchema = z.object({
2535
- companyId: UuidSchema
2447
+ export const CompanyIdParamsSchema = z.object({
2448
+ companyId: UuidSchema
2536
2449
  })
2537
2450
  ```
2538
2451
 
2539
2452
  ### `ContactIdParamsSchema`
2540
2453
 
2541
2454
  ```typescript
2542
- export const ContactIdParamsSchema = z.object({
2543
- contactId: UuidSchema
2455
+ export const ContactIdParamsSchema = z.object({
2456
+ contactId: UuidSchema
2544
2457
  })
2545
2458
  ```
2546
2459
 
2547
2460
  ### `ListCompaniesQuerySchema`
2548
2461
 
2549
2462
  ```typescript
2550
- export const ListCompaniesQuerySchema = z
2551
- .object({
2552
- search: z.string().trim().min(1).max(200).optional(),
2553
- listId: UuidSchema.optional(),
2554
- domain: z.string().trim().min(1).max(255).optional(),
2555
- website: z.string().trim().min(1).max(2048).optional(),
2556
- segment: z.string().trim().min(1).max(255).optional(),
2557
- category: z.string().trim().min(1).max(255).optional(),
2558
- pipelineStatus: z.unknown().optional(),
2559
- batchId: z.string().trim().min(1).max(255).optional(),
2560
- status: AcqCompanyStatusSchema.optional(),
2561
- includeAll: QueryBooleanSchema.optional(),
2562
- limit: z.coerce.number().int().min(1).max(5000).default(50),
2563
- offset: z.coerce.number().int().min(0).default(0)
2564
- })
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
+ })
2565
2478
  .strict()
2566
2479
  ```
2567
2480
 
2568
2481
  ### `ListContactsQuerySchema`
2569
2482
 
2570
2483
  ```typescript
2571
- export const ListContactsQuerySchema = z
2572
- .object({
2573
- search: z.string().trim().min(1).max(200).optional(),
2574
- listId: UuidSchema.optional(),
2575
- openingLineIsNull: QueryBooleanSchema.optional(),
2576
- batchId: z.string().trim().min(1).max(255).optional(),
2577
- contactStatus: AcqContactStatusSchema.optional(),
2578
- limit: z.coerce.number().int().min(1).max(5000).default(5000),
2579
- offset: z.coerce.number().int().min(0).default(0)
2580
- })
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
+ })
2581
2494
  .strict()
2582
2495
  ```
2583
2496
 
2584
2497
  ### `CreateCompanyRequestSchema`
2585
2498
 
2586
2499
  ```typescript
2587
- export const CreateCompanyRequestSchema = z
2588
- .object({
2589
- name: z.string().trim().min(1).max(255),
2590
- clientId: UuidSchema.nullable().optional(),
2591
- domain: z.string().trim().min(1).max(255).optional(),
2592
- linkedinUrl: z.string().trim().url().optional(),
2593
- website: z.string().trim().url().optional(),
2594
- numEmployees: z.number().int().min(0).optional(),
2595
- foundedYear: z.number().int().optional(),
2596
- locationCity: z.string().trim().min(1).max(255).optional(),
2597
- locationState: z.string().trim().min(1).max(255).optional(),
2598
- category: z.string().trim().min(1).max(255).optional(),
2599
- source: z.string().trim().min(1).max(255).optional(),
2600
- batchId: z.string().trim().min(1).max(255).optional(),
2601
- pipelineStatus: z.unknown().optional(),
2602
- verticalResearch: z.string().trim().min(1).max(5000).optional()
2603
- })
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
+ })
2604
2517
  .strict()
2605
2518
  ```
2606
2519
 
2607
2520
  ### `UpdateCompanyRequestSchema`
2608
2521
 
2609
2522
  ```typescript
2610
- export const UpdateCompanyRequestSchema = z
2611
- .object({
2612
- name: z.string().trim().min(1).max(255).optional(),
2613
- clientId: UuidSchema.nullable().optional(),
2614
- domain: z.string().trim().min(1).max(255).optional(),
2615
- linkedinUrl: z.string().trim().url().optional(),
2616
- website: z.string().trim().url().optional(),
2617
- numEmployees: z.number().int().min(0).optional(),
2618
- foundedYear: z.number().int().optional(),
2619
- locationCity: z.string().trim().min(1).max(255).optional(),
2620
- locationState: z.string().trim().min(1).max(255).optional(),
2621
- category: z.string().trim().min(1).max(255).optional(),
2622
- segment: z.string().trim().min(1).max(255).optional(),
2623
- processingState: CompanyProcessingStateSchema.optional(),
2624
- pipelineStatus: z.unknown().optional(),
2625
- enrichmentData: z.record(z.string(), z.unknown()).optional(),
2626
- source: z.string().trim().min(1).max(255).optional(),
2627
- batchId: z.string().trim().min(1).max(255).optional(),
2628
- status: AcqCompanyStatusSchema.optional(),
2629
- verticalResearch: z.string().trim().min(1).max(5000).nullable().optional()
2630
- })
2631
- .strict()
2632
- .refine(
2633
- (data) =>
2634
- data.name !== undefined ||
2635
- data.clientId !== undefined ||
2636
- data.domain !== undefined ||
2637
- data.linkedinUrl !== undefined ||
2638
- data.website !== undefined ||
2639
- data.numEmployees !== undefined ||
2640
- data.foundedYear !== undefined ||
2641
- data.locationCity !== undefined ||
2642
- data.locationState !== undefined ||
2643
- data.category !== undefined ||
2644
- data.segment !== undefined ||
2645
- data.processingState !== undefined ||
2646
- data.pipelineStatus !== undefined ||
2647
- data.enrichmentData !== undefined ||
2648
- data.source !== undefined ||
2649
- data.batchId !== undefined ||
2650
- data.status !== undefined ||
2651
- data.verticalResearch !== undefined,
2652
- {
2653
- message: 'At least one field must be provided'
2654
- }
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
+ }
2655
2568
  )
2656
2569
  ```
2657
2570
 
2658
2571
  ### `CreateContactRequestSchema`
2659
2572
 
2660
2573
  ```typescript
2661
- export const CreateContactRequestSchema = z
2662
- .object({
2663
- email: z.string().trim().email(),
2664
- clientId: UuidSchema.nullable().optional(),
2665
- companyId: UuidSchema.optional(),
2666
- firstName: z.string().trim().min(1).max(255).optional(),
2667
- lastName: z.string().trim().min(1).max(255).optional(),
2668
- linkedinUrl: z.string().trim().url().optional(),
2669
- title: z.string().trim().min(1).max(255).optional(),
2670
- source: z.string().trim().min(1).max(255).optional(),
2671
- sourceId: z.string().trim().min(1).max(255).optional(),
2672
- batchId: z.string().trim().min(1).max(255).optional(),
2673
- pipelineStatus: z.unknown().optional()
2674
- })
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
+ })
2675
2588
  .strict()
2676
2589
  ```
2677
2590
 
2678
2591
  ### `UpdateContactRequestSchema`
2679
2592
 
2680
2593
  ```typescript
2681
- export const UpdateContactRequestSchema = z
2682
- .object({
2683
- companyId: UuidSchema.optional(),
2684
- clientId: UuidSchema.nullable().optional(),
2685
- emailValid: AcqEmailValidSchema.optional(),
2686
- firstName: z.string().trim().min(1).max(255).optional(),
2687
- lastName: z.string().trim().min(1).max(255).optional(),
2688
- linkedinUrl: z.string().trim().url().optional(),
2689
- title: z.string().trim().min(1).max(255).optional(),
2690
- headline: z.string().trim().min(1).max(5000).optional(),
2691
- filterReason: z.string().trim().min(1).max(5000).optional(),
2692
- openingLine: z.string().trim().min(1).max(5000).optional(),
2693
- processingState: ContactProcessingStateSchema.optional(),
2694
- pipelineStatus: z.unknown().optional(),
2695
- enrichmentData: z.record(z.string(), z.unknown()).optional(),
2696
- status: AcqContactStatusSchema.optional()
2697
- })
2698
- .strict()
2699
- .refine(
2700
- (data) =>
2701
- data.companyId !== undefined ||
2702
- data.clientId !== undefined ||
2703
- data.emailValid !== undefined ||
2704
- data.firstName !== undefined ||
2705
- data.lastName !== undefined ||
2706
- data.linkedinUrl !== undefined ||
2707
- data.title !== undefined ||
2708
- data.headline !== undefined ||
2709
- data.filterReason !== undefined ||
2710
- data.openingLine !== undefined ||
2711
- data.processingState !== undefined ||
2712
- data.pipelineStatus !== undefined ||
2713
- data.enrichmentData !== undefined ||
2714
- data.status !== undefined,
2715
- {
2716
- message: 'At least one field must be provided'
2717
- }
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
+ }
2718
2631
  )
2719
2632
  ```
2720
2633
 
2721
2634
  ### `AcqCompanyResponseSchema`
2722
2635
 
2723
2636
  ```typescript
2724
- export const AcqCompanyResponseSchema = z.object({
2725
- id: z.string(),
2726
- organizationId: z.string(),
2727
- clientId: z.string().nullable().optional(),
2728
- name: z.string(),
2729
- domain: z.string().nullable(),
2730
- linkedinUrl: z.string().nullable(),
2731
- website: z.string().nullable(),
2732
- numEmployees: z.number().nullable(),
2733
- foundedYear: z.number().nullable(),
2734
- locationCity: z.string().nullable(),
2735
- locationState: z.string().nullable(),
2736
- category: z.string().nullable(),
2737
- categoryPain: z.string().nullable(),
2738
- segment: z.string().nullable(),
2739
- processingState: CompanyProcessingStateSchema.nullable(),
2740
- pipelineStatus: z.unknown().nullable().optional(),
2741
- enrichmentData: z.record(z.string(), z.unknown()).nullable(),
2742
- source: z.string().nullable(),
2743
- batchId: z.string().nullable(),
2744
- status: AcqCompanyStatusSchema,
2745
- contactCount: z.number().int().min(0),
2746
- verticalResearch: z.string().nullable(),
2747
- createdAt: z.string(),
2748
- 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()
2749
2662
  })
2750
2663
  ```
2751
2664
 
2752
2665
  ### `AcqCompanyListResponseSchema`
2753
2666
 
2754
2667
  ```typescript
2755
- export const AcqCompanyListResponseSchema = z.object({
2756
- data: z.array(AcqCompanyResponseSchema),
2757
- total: z.number().int(),
2758
- limit: z.number().int(),
2759
- 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()
2760
2673
  })
2761
2674
  ```
2762
2675
 
2763
2676
  ### `AcqCompanyFacetsResponseSchema`
2764
2677
 
2765
2678
  ```typescript
2766
- export const AcqCompanyFacetsResponseSchema = z.object({
2767
- segments: z.array(z.string()),
2768
- categories: z.array(z.string()),
2769
- 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)
2770
2683
  })
2771
2684
  ```
2772
2685
 
2773
2686
  ### `AcqContactCompanySummarySchema`
2774
2687
 
2775
2688
  ```typescript
2776
- export const AcqContactCompanySummarySchema = z.object({
2777
- id: z.string(),
2778
- name: z.string(),
2779
- domain: z.string().nullable(),
2780
- website: z.string().nullable(),
2781
- linkedinUrl: z.string().nullable(),
2782
- segment: z.string().nullable(),
2783
- category: z.string().nullable(),
2784
- 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
2785
2698
  })
2786
2699
  ```
2787
2700
 
2788
2701
  ### `AcqContactResponseSchema`
2789
2702
 
2790
2703
  ```typescript
2791
- export const AcqContactResponseSchema = z.object({
2792
- id: z.string(),
2793
- organizationId: z.string(),
2794
- clientId: z.string().nullable().optional(),
2795
- companyId: z.string().nullable(),
2796
- email: z.string(),
2797
- emailValid: AcqEmailValidSchema.nullable(),
2798
- firstName: z.string().nullable(),
2799
- lastName: z.string().nullable(),
2800
- linkedinUrl: z.string().nullable(),
2801
- title: z.string().nullable(),
2802
- headline: z.string().nullable(),
2803
- filterReason: z.string().nullable(),
2804
- openingLine: z.string().nullable(),
2805
- source: z.string().nullable(),
2806
- sourceId: z.string().nullable(),
2807
- processingState: ContactProcessingStateSchema.nullable(),
2808
- pipelineStatus: z.unknown().nullable().optional(),
2809
- enrichmentData: z.record(z.string(), z.unknown()).nullable(),
2810
- attioPersonId: z.string().nullable(),
2811
- batchId: z.string().nullable(),
2812
- status: AcqContactStatusSchema,
2813
- company: AcqContactCompanySummarySchema.nullable().optional(),
2814
- createdAt: z.string(),
2815
- 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()
2816
2729
  })
2817
2730
  ```
2818
2731
 
2819
2732
  ### `AcqContactListResponseSchema`
2820
2733
 
2821
2734
  ```typescript
2822
- export const AcqContactListResponseSchema = z.object({
2823
- data: z.array(AcqContactResponseSchema),
2824
- total: z.number().int(),
2825
- limit: z.number().int(),
2826
- 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()
2827
2740
  })
2828
2741
  ```
2829
2742
 
@@ -2836,242 +2749,243 @@ export const AcqArtifactOwnerKindSchema = z.enum(['company', 'contact', 'deal',
2836
2749
  ### `ListArtifactsQuerySchema`
2837
2750
 
2838
2751
  ```typescript
2839
- export const ListArtifactsQuerySchema = z
2840
- .object({
2841
- ownerKind: AcqArtifactOwnerKindSchema,
2842
- ownerId: UuidSchema
2843
- })
2752
+ export const ListArtifactsQuerySchema = z
2753
+ .object({
2754
+ ownerKind: AcqArtifactOwnerKindSchema,
2755
+ ownerId: UuidSchema
2756
+ })
2844
2757
  .strict()
2845
2758
  ```
2846
2759
 
2847
2760
  ### `CreateArtifactRequestSchema`
2848
2761
 
2849
2762
  ```typescript
2850
- export const CreateArtifactRequestSchema = z
2851
- .object({
2852
- ownerKind: AcqArtifactOwnerKindSchema,
2853
- ownerId: UuidSchema,
2854
- kind: z.string().trim().min(1).max(255),
2855
- content: z.record(z.string(), z.unknown()),
2856
- sourceExecutionId: UuidSchema.optional()
2857
- })
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
+ })
2858
2771
  .strict()
2859
2772
  ```
2860
2773
 
2861
2774
  ### `AcqArtifactResponseSchema`
2862
2775
 
2863
2776
  ```typescript
2864
- export const AcqArtifactResponseSchema = z.object({
2865
- id: z.string(),
2866
- organizationId: z.string(),
2867
- ownerKind: z.string(),
2868
- ownerId: z.string(),
2869
- kind: z.string(),
2870
- content: z.record(z.string(), z.unknown()),
2871
- sourceExecutionId: z.string().nullable(),
2872
- createdBy: z.string().nullable(),
2873
- createdAt: z.string(),
2874
- 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()
2875
2788
  })
2876
2789
  ```
2877
2790
 
2878
2791
  ### `AcqArtifactListResponseSchema`
2879
2792
 
2880
2793
  ```typescript
2881
- export const AcqArtifactListResponseSchema = z.object({
2882
- artifacts: z.array(AcqArtifactResponseSchema)
2794
+ export const AcqArtifactListResponseSchema = z.object({
2795
+ artifacts: z.array(AcqArtifactResponseSchema)
2883
2796
  })
2884
2797
  ```
2885
2798
 
2886
2799
  ### `ListMembersQuerySchema`
2887
2800
 
2888
2801
  ```typescript
2889
- export const ListMembersQuerySchema = z
2890
- .object({
2891
- limit: z.coerce.number().int().min(1).max(500).default(50),
2892
- offset: z.coerce.number().int().min(0).default(0)
2893
- })
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
+ })
2894
2807
  .strict()
2895
2808
  ```
2896
2809
 
2897
2810
  ### `MemberIdParamsSchema`
2898
2811
 
2899
2812
  ```typescript
2900
- export const MemberIdParamsSchema = z.object({
2901
- memberId: UuidSchema
2813
+ export const MemberIdParamsSchema = z.object({
2814
+ memberId: UuidSchema
2902
2815
  })
2903
2816
  ```
2904
2817
 
2905
2818
  ### `AcqListMemberContactSummarySchema`
2906
2819
 
2907
2820
  ```typescript
2908
- export const AcqListMemberContactSummarySchema = z.object({
2909
- id: z.string(),
2910
- email: z.string(),
2911
- firstName: z.string().nullable(),
2912
- lastName: z.string().nullable(),
2913
- title: z.string().nullable(),
2914
- linkedinUrl: z.string().nullable(),
2915
- 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()
2916
2829
  })
2917
2830
  ```
2918
2831
 
2919
2832
  ### `AcqListMemberResponseSchema`
2920
2833
 
2921
2834
  ```typescript
2922
- export const AcqListMemberResponseSchema = z.object({
2923
- id: z.string(),
2924
- listId: z.string(),
2925
- contactId: z.string(),
2926
- pipelineKey: z.string(),
2927
- stageKey: z.string(),
2928
- stateKey: z.string(),
2929
- activityLog: z.unknown(),
2930
- addedAt: z.string(),
2931
- addedBy: z.string().nullable(),
2932
- sourceExecutionId: z.string().nullable(),
2933
- 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()
2934
2847
  })
2935
2848
  ```
2936
2849
 
2937
2850
  ### `AcqListMembersResponseSchema`
2938
2851
 
2939
2852
  ```typescript
2940
- export const AcqListMembersResponseSchema = z.object({
2941
- members: z.array(AcqListMemberResponseSchema)
2853
+ export const AcqListMembersResponseSchema = z.object({
2854
+ members: z.array(AcqListMemberResponseSchema)
2942
2855
  })
2943
2856
  ```
2944
2857
 
2945
2858
  ### `ListCompanyIdParamsSchema`
2946
2859
 
2947
2860
  ```typescript
2948
- export const ListCompanyIdParamsSchema = z.object({
2949
- listCompanyId: UuidSchema
2861
+ export const ListCompanyIdParamsSchema = z.object({
2862
+ listCompanyId: UuidSchema
2950
2863
  })
2951
2864
  ```
2952
2865
 
2953
2866
  ### `AcqListCompanyResponseSchema`
2954
2867
 
2955
2868
  ```typescript
2956
- export const AcqListCompanyResponseSchema = z.object({
2957
- id: z.string(),
2958
- listId: z.string(),
2959
- companyId: z.string(),
2960
- pipelineKey: z.string(),
2961
- stageKey: z.string(),
2962
- stateKey: z.string(),
2963
- activityLog: z.unknown(),
2964
- addedAt: z.string(),
2965
- addedBy: z.string().nullable(),
2966
- 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()
2967
2880
  })
2968
2881
  ```
2969
2882
 
2970
2883
  ### `AcqCompanySchemas`
2971
2884
 
2972
2885
  ```typescript
2973
- export const AcqCompanySchemas = {
2974
- CompanyProcessingState: CompanyProcessingStateSchema,
2975
- CompanyIdParams: CompanyIdParamsSchema,
2976
- ListCompaniesQuery: ListCompaniesQuerySchema,
2977
- CreateCompanyRequest: CreateCompanyRequestSchema,
2978
- UpdateCompanyRequest: UpdateCompanyRequestSchema,
2979
- AcqCompanyResponse: AcqCompanyResponseSchema,
2980
- AcqCompanyListResponse: AcqCompanyListResponseSchema,
2981
- 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
2982
2895
  }
2983
2896
  ```
2984
2897
 
2985
2898
  ### `AcqContactSchemas`
2986
2899
 
2987
2900
  ```typescript
2988
- export const AcqContactSchemas = {
2989
- ContactProcessingState: ContactProcessingStateSchema,
2990
- ContactIdParams: ContactIdParamsSchema,
2991
- ListContactsQuery: ListContactsQuerySchema,
2992
- CreateContactRequest: CreateContactRequestSchema,
2993
- UpdateContactRequest: UpdateContactRequestSchema,
2994
- AcqContactResponse: AcqContactResponseSchema,
2995
- 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
2996
2909
  }
2997
2910
  ```
2998
2911
 
2999
2912
  ### `AcqListSchemas`
3000
2913
 
3001
2914
  ```typescript
3002
- export const AcqListSchemas = {
3003
- // Params
3004
- ListIdParams: ListIdParamsSchema,
3005
-
3006
- // Primitives (for UI / tests)
3007
- ListStatus: ListStatusSchema,
3008
- ScrapingConfig: ScrapingConfigSchema,
3009
- IcpRubric: IcpRubricSchema,
3010
- PipelineConfig: PipelineConfigSchema,
3011
- PipelineStage: PipelineStageSchema,
3012
- BuildPlanSnapshot: BuildPlanSnapshotSchema,
3013
- BuildPlanSnapshotStep: BuildPlanSnapshotStepSchema,
3014
- AcqListMetadata: AcqListMetadataSchema,
3015
- LeadGenStageKey: LeadGenStageKeySchema,
3016
- LeadGenActionKey: LeadGenActionKeySchema,
3017
- ProcessingStageStatus: ProcessingStageStatusSchema,
3018
- ProcessingState: ProcessingStateSchema,
3019
- ListStageCounts: ListStageCountsSchema,
3020
- ListTelemetry: ListTelemetrySchema,
3021
-
3022
- // Requests
3023
- ListReadQuery: ListReadQuerySchema,
3024
- GetListQuery: GetListQuerySchema,
3025
- CreateListRequest: CreateListRequestSchema,
3026
- UpdateListRequest: UpdateListRequestSchema,
3027
- UpdateListStatusRequest: UpdateListStatusRequestSchema,
3028
- UpdateListConfigRequest: UpdateListConfigRequestSchema,
3029
- AddCompaniesToListRequest: AddCompaniesToListRequestSchema,
3030
- RemoveCompaniesFromListRequest: RemoveCompaniesFromListRequestSchema,
3031
- AddContactsToListRequest: AddContactsToListRequestSchema,
3032
- RecordListExecutionRequest: RecordListExecutionRequestSchema,
3033
-
3034
- // Responses
3035
- AcqListResponse: AcqListResponseSchema,
3036
- AcqListDetailResponse: AcqListDetailResponseSchema,
3037
- AcqListListResponse: AcqListListResponseSchema,
3038
- AcqListDealRef: AcqListDealRefSchema,
3039
- AcqListLineage: AcqListLineageSchema,
3040
- AcqListStatusResponse: AcqListStatusResponseSchema,
3041
- ListTelemetryResponse: ListTelemetryResponseSchema,
3042
- ListTelemetryListResponse: ListTelemetryListResponseSchema,
3043
- ListExecutionsResponse: ListExecutionsResponseSchema,
3044
- 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
+ DataMode: DataModeSchema,
2925
+ PipelineStage: PipelineStageSchema,
2926
+ BuildPlanSnapshot: BuildPlanSnapshotSchema,
2927
+ BuildPlanSnapshotStep: BuildPlanSnapshotStepSchema,
2928
+ AcqListMetadata: AcqListMetadataSchema,
2929
+ LeadGenStageKey: LeadGenStageKeySchema,
2930
+ LeadGenActionKey: LeadGenActionKeySchema,
2931
+ ProcessingStageStatus: ProcessingStageStatusSchema,
2932
+ ProcessingState: ProcessingStateSchema,
2933
+ ListStageCounts: ListStageCountsSchema,
2934
+ ListTelemetry: ListTelemetrySchema,
2935
+
2936
+ // Requests
2937
+ ListReadQuery: ListReadQuerySchema,
2938
+ GetListQuery: GetListQuerySchema,
2939
+ CreateListRequest: CreateListRequestSchema,
2940
+ UpdateListRequest: UpdateListRequestSchema,
2941
+ UpdateListStatusRequest: UpdateListStatusRequestSchema,
2942
+ UpdateListConfigRequest: UpdateListConfigRequestSchema,
2943
+ AddCompaniesToListRequest: AddCompaniesToListRequestSchema,
2944
+ RemoveCompaniesFromListRequest: RemoveCompaniesFromListRequestSchema,
2945
+ AddContactsToListRequest: AddContactsToListRequestSchema,
2946
+ RecordListExecutionRequest: RecordListExecutionRequestSchema,
2947
+
2948
+ // Responses
2949
+ AcqListResponse: AcqListResponseSchema,
2950
+ AcqListDetailResponse: AcqListDetailResponseSchema,
2951
+ AcqListListResponse: AcqListListResponseSchema,
2952
+ AcqListDealRef: AcqListDealRefSchema,
2953
+ AcqListLineage: AcqListLineageSchema,
2954
+ AcqListStatusResponse: AcqListStatusResponseSchema,
2955
+ ListTelemetryResponse: ListTelemetryResponseSchema,
2956
+ ListTelemetryListResponse: ListTelemetryListResponseSchema,
2957
+ ListExecutionsResponse: ListExecutionsResponseSchema,
2958
+ ListProgressResponse: ListProgressResponseSchema
3045
2959
  }
3046
2960
  ```
3047
2961
 
3048
2962
  ### `AcqSubstrateSchemas`
3049
2963
 
3050
2964
  ```typescript
3051
- export const AcqSubstrateSchemas = {
3052
- // Artifacts
3053
- ListArtifactsQuery: ListArtifactsQuerySchema,
3054
- CreateArtifactRequest: CreateArtifactRequestSchema,
3055
- AcqArtifactResponse: AcqArtifactResponseSchema,
3056
- AcqArtifactListResponse: AcqArtifactListResponseSchema,
3057
-
3058
- // List members
3059
- ListMembersQuery: ListMembersQuerySchema,
3060
- ListRecordsQuery: ListRecordsQuerySchema,
3061
- MemberIdParams: MemberIdParamsSchema,
3062
- AcqListMemberResponse: AcqListMemberResponseSchema,
3063
- AcqListMembersResponse: AcqListMembersResponseSchema,
3064
- AcqListCompanyRecordRow: AcqListCompanyRecordRowSchema,
3065
- AcqListContactRecordRow: AcqListContactRecordRowSchema,
3066
- ListRecordRow: ListRecordRowSchema,
3067
- ListRecordsResponse: ListRecordsResponseSchema,
3068
-
3069
- // List companies
3070
- ListCompanyIdParams: ListCompanyIdParamsSchema,
3071
- AcqListCompanyResponse: AcqListCompanyResponseSchema,
3072
-
3073
- // Transition (generic stateful substrate)
3074
- TransitionItemRequest: TransitionItemRequestSchema
2965
+ export const AcqSubstrateSchemas = {
2966
+ // Artifacts
2967
+ ListArtifactsQuery: ListArtifactsQuerySchema,
2968
+ CreateArtifactRequest: CreateArtifactRequestSchema,
2969
+ AcqArtifactResponse: AcqArtifactResponseSchema,
2970
+ AcqArtifactListResponse: AcqArtifactListResponseSchema,
2971
+
2972
+ // List members
2973
+ ListMembersQuery: ListMembersQuerySchema,
2974
+ ListRecordsQuery: ListRecordsQuerySchema,
2975
+ MemberIdParams: MemberIdParamsSchema,
2976
+ AcqListMemberResponse: AcqListMemberResponseSchema,
2977
+ AcqListMembersResponse: AcqListMembersResponseSchema,
2978
+ AcqListCompanyRecordRow: AcqListCompanyRecordRowSchema,
2979
+ AcqListContactRecordRow: AcqListContactRecordRowSchema,
2980
+ ListRecordRow: ListRecordRowSchema,
2981
+ ListRecordsResponse: ListRecordsResponseSchema,
2982
+
2983
+ // List companies
2984
+ ListCompanyIdParams: ListCompanyIdParamsSchema,
2985
+ AcqListCompanyResponse: AcqListCompanyResponseSchema,
2986
+
2987
+ // Transition (generic stateful substrate)
2988
+ TransitionItemRequest: TransitionItemRequestSchema
3075
2989
  }
3076
2990
  ```
3077
2991
 
@@ -3122,136 +3036,42 @@ export const StatefulSchema = z.object({
3122
3036
  ### `StatefulStateDefinition`
3123
3037
 
3124
3038
  ```typescript
3125
- /** One state within a stage minimal shape: key + display label. */
3126
- export interface StatefulStateDefinition {
3127
- /** Matches state_key values written by workflow steps. */
3128
- stateKey: string
3129
- label: string
3039
+ /** One state within a stage: minimal shape of key + display label. */
3040
+ export interface StatefulStateDefinition {
3041
+ /** Matches state_key values written by workflow steps. */
3042
+ stateKey: string
3043
+ label: string
3130
3044
  }
3131
3045
  ```
3132
3046
 
3133
3047
  ### `StatefulStageDefinition`
3134
3048
 
3135
3049
  ```typescript
3136
- /** One stage within a pipeline has a stage_key and an ordered list of valid states. */
3137
- export interface StatefulStageDefinition {
3138
- /** Matches stage_key values written by workflow steps. */
3139
- stageKey: string
3140
- label: string
3141
- /** UI color token. Consumers may map this to their design system. */
3142
- color?: string
3143
- states: StatefulStateDefinition[]
3050
+ /** One stage within a pipeline: has a stage_key and ordered valid states. */
3051
+ export interface StatefulStageDefinition {
3052
+ /** Matches stage_key values written by workflow steps. */
3053
+ stageKey: string
3054
+ label: string
3055
+ /** UI color token. Consumers may map this to their design system. */
3056
+ color?: string
3057
+ states: StatefulStateDefinition[]
3144
3058
  }
3145
3059
  ```
3146
3060
 
3147
3061
  ### `StatefulPipelineDefinition`
3148
3062
 
3149
3063
  ```typescript
3150
- /**
3151
- * Pipeline definition for a single entity participating in the Stateful trait.
3152
- * Parallel to acq_deals' pipeline_key concept but structured for lead-gen entities.
3153
- */
3154
- export interface StatefulPipelineDefinition {
3155
- /** Matches pipeline_key values in the database (e.g. 'lead-gen'). */
3156
- pipelineKey: string
3157
- label: string
3158
- /** Entity this pipeline applies to (e.g. 'acq.list', 'acq.list-member', 'acq.list-company'). */
3159
- entityKey: string
3160
- stages: StatefulStageDefinition[]
3161
- }
3162
- ```
3163
-
3164
- ### `ACQ_LIST_MEMBERS_LEAD_GEN_PIPELINE`
3165
-
3166
- ```typescript
3167
- /**
3168
- * Lead-gen pipeline definition for acq_list_members (contacts).
3169
- * Three stages matching the post-restructure sales subdomain tree.
3170
- *
3171
- * Note: members visit outreach and prospecting states depending on which
3172
- * workflow last processed them. stage_key is set per-transition by the workflow.
3173
- */
3174
- export const ACQ_LIST_MEMBERS_LEAD_GEN_PIPELINE: StatefulPipelineDefinition = {
3175
- pipelineKey: 'lead-gen',
3176
- label: 'Lead Generation',
3177
- entityKey: 'acq.list-member',
3178
- stages: [
3179
- {
3180
- stageKey: 'outreach',
3181
- label: 'Outreach',
3182
- states: [
3183
- PENDING_STATE,
3184
- { stateKey: 'personalized', label: 'Personalized' },
3185
- { stateKey: 'uploaded', label: 'Uploaded' },
3186
- { stateKey: 'interested', label: 'Interested' }
3187
- ]
3188
- },
3189
- {
3190
- stageKey: 'prospecting',
3191
- label: 'Prospecting',
3192
- states: [
3193
- PENDING_STATE,
3194
- { stateKey: 'discovered', label: 'Discovered' },
3195
- { stateKey: 'verified', label: 'Verified' }
3196
- ]
3197
- },
3198
- {
3199
- stageKey: 'qualification',
3200
- label: 'Qualification',
3201
- states: [PENDING_STATE]
3202
- }
3203
- ]
3204
- }
3205
- ```
3206
-
3207
- ### `ACQ_LIST_COMPANIES_LEAD_GEN_PIPELINE`
3208
-
3209
- ```typescript
3210
- /**
3211
- * Lead-gen pipeline definition for acq_list_companies.
3212
- * Three stages matching the post-restructure sales subdomain tree.
3213
- *
3214
- * Note: companies visit prospecting and qualification states depending on which
3215
- * workflow last processed them. stage_key is set per-transition by the workflow.
3216
- */
3217
- export const ACQ_LIST_COMPANIES_LEAD_GEN_PIPELINE: StatefulPipelineDefinition = {
3218
- pipelineKey: 'lead-gen',
3219
- label: 'Lead Generation',
3220
- entityKey: 'acq.list-company',
3221
- stages: [
3222
- {
3223
- stageKey: 'outreach',
3224
- label: 'Outreach',
3225
- states: [PENDING_STATE, { stateKey: 'uploaded', label: 'Uploaded' }]
3226
- },
3227
- {
3228
- stageKey: 'prospecting',
3229
- label: 'Prospecting',
3230
- states: [
3231
- PENDING_STATE,
3232
- { stateKey: 'populated', label: 'Populated' },
3233
- { stateKey: 'extracted', label: 'Extracted' }
3234
- ]
3235
- },
3236
- {
3237
- stageKey: 'qualification',
3238
- label: 'Qualification',
3239
- states: [PENDING_STATE, { stateKey: 'qualified', label: 'Qualified' }]
3240
- }
3241
- ]
3242
- }
3243
- ```
3244
-
3245
- ### `LEAD_GEN_PIPELINE_DEFINITIONS`
3246
-
3247
- ```typescript
3248
- /**
3249
- * All lead-gen pipeline definitions indexed by entity key.
3250
- * Use findPipeline() to locate a definition by pipeline_key within any of these arrays.
3251
- */
3252
- export const LEAD_GEN_PIPELINE_DEFINITIONS: Record<string, StatefulPipelineDefinition[]> = {
3253
- 'acq.list-member': [ACQ_LIST_MEMBERS_LEAD_GEN_PIPELINE],
3254
- 'acq.list-company': [ACQ_LIST_COMPANIES_LEAD_GEN_PIPELINE]
3064
+ /**
3065
+ * Pipeline definition for a single entity participating in the Stateful trait.
3066
+ * Parallel to acq_deals' pipeline_key concept but structured for any entity.
3067
+ */
3068
+ export interface StatefulPipelineDefinition {
3069
+ /** Matches pipeline_key values in the database. */
3070
+ pipelineKey: string
3071
+ label: string
3072
+ /** Entity this pipeline applies to. */
3073
+ entityKey: string
3074
+ stages: StatefulStageDefinition[]
3255
3075
  }
3256
3076
  ```
3257
3077
 
@@ -3524,26 +3344,28 @@ export interface UpdateListConfigParams {
3524
3344
  ### `UpdateCompanyStageParams`
3525
3345
 
3526
3346
  ```typescript
3527
- export interface UpdateCompanyStageParams {
3528
- organizationId: string
3529
- listId: string
3530
- companyId: string
3531
- stage: string
3532
- status?: ProcessingStageStatus
3533
- executionId?: string
3347
+ export interface UpdateCompanyStageParams {
3348
+ organizationId: string
3349
+ listId: string
3350
+ companyId: string
3351
+ stage: string
3352
+ status?: ProcessingStageStatus
3353
+ data?: unknown
3354
+ executionId?: string
3534
3355
  }
3535
3356
  ```
3536
3357
 
3537
3358
  ### `UpdateContactStageParams`
3538
3359
 
3539
3360
  ```typescript
3540
- export interface UpdateContactStageParams {
3541
- organizationId: string
3542
- listId: string
3543
- contactId: string
3544
- stage: string
3545
- status?: ProcessingStageStatus
3546
- executionId?: string
3361
+ export interface UpdateContactStageParams {
3362
+ organizationId: string
3363
+ listId: string
3364
+ contactId: string
3365
+ stage: string
3366
+ status?: ProcessingStageStatus
3367
+ data?: unknown
3368
+ executionId?: string
3547
3369
  }
3548
3370
  ```
3549
3371
 
@@ -3598,13 +3420,14 @@ export interface RecordListExecutionParams {
3598
3420
  ### `ListExecutionSummary`
3599
3421
 
3600
3422
  ```typescript
3601
- export interface ListExecutionSummary {
3602
- executionId: string
3603
- resourceId: string
3604
- status: string
3605
- createdAt: string
3606
- completedAt: string | null
3607
- durationMs: number | null
3423
+ export interface ListExecutionSummary {
3424
+ executionId: string
3425
+ resourceId: string
3426
+ status: string
3427
+ createdAt: string
3428
+ completedAt: string | null
3429
+ durationMs: number | null
3430
+ input?: unknown
3608
3431
  }
3609
3432
  ```
3610
3433
 
@@ -3667,168 +3490,188 @@ export interface BulkImportCompaniesResult {
3667
3490
  ### `LeadToolMap`
3668
3491
 
3669
3492
  ```typescript
3670
- export type LeadToolMap = {
3671
- // List operations
3672
- listLists: { params: Record<string, never>; result: AcqList[] }
3673
- createList: { params: Omit<CreateListParams, 'organizationId'>; result: AcqList }
3674
- updateList: { params: { id: string } & UpdateListParams; result: AcqList }
3675
- deleteList: { params: { id: string }; result: void }
3676
- addContactsToList: { params: Omit<AddContactsToListParams, 'organizationId'>; result: AddContactsToListResult }
3677
- addCompaniesToList: { params: Omit<AddCompaniesToListParams, 'organizationId'>; result: AddCompaniesToListResult }
3678
- updateCompanyStage: {
3679
- params: Omit<UpdateCompanyStageParams, 'organizationId'>
3680
- result: void
3681
- }
3682
- updateContactStage: {
3683
- params: Omit<UpdateContactStageParams, 'organizationId'>
3684
- result: void
3685
- }
3686
- // Company operations
3687
- createCompany: { params: Omit<CreateCompanyParams, 'organizationId'>; result: AcqCompany }
3688
- upsertCompany: { params: Omit<UpsertCompanyParams, 'organizationId'>; result: AcqCompany }
3689
- updateCompany: { params: { id: string } & UpdateCompanyParams; result: AcqCompany }
3690
- getCompany: { params: { id: string }; result: AcqCompany | null }
3691
- listCompanies: { params: CompanyFilters; result: AcqCompany[] }
3692
- deleteCompany: { params: { id: string }; result: void }
3693
- // Contact operations
3694
- createContact: { params: Omit<CreateContactParams, 'organizationId'>; result: AcqContact }
3695
- upsertContact: { params: Omit<UpsertContactParams, 'organizationId'>; result: AcqContact }
3696
- updateContact: { params: { id: string } & UpdateContactParams; result: AcqContact }
3697
- getContact: { params: { id: string }; result: AcqContact | null }
3698
- getContactByEmail: { params: { email: string }; result: AcqContact | null }
3699
- listContacts: {
3700
- params: ContactFilters & { limit?: number; offset?: number }
3701
- result: PaginatedResult<AcqContact>
3702
- }
3703
- deleteContact: { params: { id: string }; result: void }
3704
- bulkImportContacts: { params: Omit<BulkImportParams, 'organizationId'>; result: BulkImportResult }
3705
- bulkImportCompanies: {
3706
- params: Omit<BulkImportCompaniesParams, 'organizationId'>
3707
- result: BulkImportCompaniesResult
3708
- }
3709
- deactivateContactsByCompany: {
3710
- params: { companyId: string }
3711
- result: { deactivated: number }
3712
- }
3713
- // Deal operations
3714
- upsertDeal: { params: Omit<UpsertDealParams, 'organizationId'>; result: AcqDeal }
3715
- getDealByEmail: { params: { email: string }; result: AcqDeal | null }
3716
- getDealByEnvelopeId: { params: { envelopeId: string }; result: AcqDeal | null }
3717
- updateDealEnvelopeId: { params: { dealId: string; envelopeId: string }; result: AcqDeal | null }
3718
- getDealById: { params: Omit<GetDealByIdParams, 'organizationId'>; result: AcqDeal | null }
3719
- getContactById: { params: Omit<GetContactByIdParams, 'organizationId'>; result: AcqContact | null }
3720
- getCompanyById: { params: Omit<GetCompanyByIdParams, 'organizationId'>; result: AcqCompany | null }
3721
- // Deal-sync operations
3722
- updateDiscoveryData: { params: Omit<UpdateDiscoveryDataParams, 'organizationId'>; result: void }
3723
- updateProposalData: { params: Omit<UpdateProposalDataParams, 'organizationId'>; result: void }
3724
- markProposalSent: { params: Omit<MarkProposalSentParams, 'organizationId'>; result: void }
3725
- markProposalReviewed: { params: Omit<MarkProposalReviewedParams, 'organizationId'>; result: void }
3726
- updateCloseLostReason: { params: Omit<UpdateCloseLostReasonParams, 'organizationId'>; result: void }
3727
- updateFees: { params: Omit<UpdateFeesParams, 'organizationId'>; result: void }
3728
- cacheInstantlyThreadIds: { params: Omit<CacheInstantlyThreadIdsParams, 'organizationId'>; result: void }
3729
- transitionItem: { params: Omit<TransitionItemParams, 'organizationId'>; result: void }
3730
- setContactNurture: { params: Omit<SetContactNurtureParams, 'organizationId'>; result: void }
3731
- cancelSchedulesAndHitlByEmail: {
3732
- params: Omit<CancelSchedulesAndHitlByEmailParams, 'organizationId'>
3733
- result: { schedulesCancelled: number; hitlDeleted: number }
3734
- }
3735
- cancelHitlByDealId: { params: Omit<CancelHitlByDealIdParams, 'organizationId'>; result: { hitlDeleted: number } }
3736
- clearDealFields: { params: Omit<ClearDealFieldsParams, 'organizationId'>; result: void }
3737
- deleteDeal: { params: Omit<DeleteDealParams, 'organizationId'>; result: void }
3738
- recordDealActivity: {
3739
- params: Omit<RecordDealActivityParams, 'organizationId'>
3740
- result: void
3741
- }
3742
- // Deal note operations
3743
- createDealNote: {
3744
- params: Omit<CreateDealNoteParams, 'organizationId'>
3745
- result: AcqDealNote
3746
- }
3747
- listDealNotes: {
3748
- params: Omit<ListDealNotesParams, 'organizationId'>
3749
- result: AcqDealNote[]
3750
- }
3751
- // Deal task operations
3752
- createDealTask: {
3753
- params: Omit<CreateDealTaskParams, 'organizationId'>
3754
- result: AcqDealTask
3755
- }
3756
- listDealTasks: {
3757
- params: Omit<ListDealTasksParams, 'organizationId'>
3758
- result: AcqDealTask[]
3759
- }
3760
- listDealTasksDue: {
3761
- params: Omit<ListDealTasksDueParams, 'organizationId'>
3762
- result: AcqDealTask[]
3763
- }
3764
- completeDealTask: {
3765
- params: Omit<CompleteDealTaskParams, 'organizationId'>
3766
- result: AcqDealTask
3767
- }
3768
- // Deal query & analytics operations
3769
- listDeals: { params: DealFilters; result: AcqDeal[] }
3770
- getDealPipelineAnalytics: { params: { recentLimit?: number }; result: DealPipelineAnalytics }
3771
- // Enrichment data operations
3772
- mergeEnrichmentData: {
3773
- params: { id: string; table: 'acq_companies' | 'acq_contacts'; data: Record<string, unknown> }
3774
- result: void
3775
- }
3776
- // Social monitoring operations
3777
- upsertSocialPosts: {
3778
- params: { posts: Omit<UpsertSocialPostParams, 'organizationId'>[] }
3779
- result: UpsertSocialPostsResult
3780
- }
3781
- setDealStateKey: {
3782
- params: {
3783
- dealId: string
3784
- stateKey: string
3785
- }
3786
- result: { ok: true }
3787
- }
3788
- // CRM workflow helpers
3789
- transitionDeal: {
3790
- params: {
3791
- dealId: string
3792
- toStage: string
3793
- toState?: string
3794
- }
3795
- result: { deal: AcqDeal }
3796
- }
3797
- loadDeal: {
3798
- params: { dealId: string }
3799
- result: DealDetail | null
3800
- }
3493
+ export type LeadToolMap = {
3494
+ // List operations
3495
+ listLists: { params: Record<string, never>; result: AcqList[] }
3496
+ createList: { params: Omit<CreateListParams, 'organizationId'>; result: AcqList }
3497
+ updateList: { params: { id: string } & UpdateListParams; result: AcqList }
3498
+ deleteList: { params: { id: string }; result: void }
3499
+ addContactsToList: { params: Omit<AddContactsToListParams, 'organizationId'>; result: AddContactsToListResult }
3500
+ addCompaniesToList: { params: Omit<AddCompaniesToListParams, 'organizationId'>; result: AddCompaniesToListResult }
3501
+ updateCompanyStage: {
3502
+ params: Omit<UpdateCompanyStageParams, 'organizationId'>
3503
+ result: void
3504
+ }
3505
+ updateContactStage: {
3506
+ params: Omit<UpdateContactStageParams, 'organizationId'>
3507
+ result: void
3508
+ }
3509
+ clearCompanyStages: {
3510
+ params: Omit<ClearCompanyStagesParams, 'organizationId'>
3511
+ result: void
3512
+ }
3513
+ clearContactStages: {
3514
+ params: Omit<ClearContactStagesParams, 'organizationId'>
3515
+ result: void
3516
+ }
3517
+ // Company operations
3518
+ createCompany: { params: Omit<CreateCompanyParams, 'organizationId'>; result: AcqCompany }
3519
+ upsertCompany: { params: Omit<UpsertCompanyParams, 'organizationId'>; result: AcqCompany }
3520
+ updateCompany: { params: { id: string } & UpdateCompanyParams; result: AcqCompany }
3521
+ getCompany: { params: { id: string }; result: AcqCompany | null }
3522
+ listCompanies: { params: CompanyFilters; result: AcqCompany[] }
3523
+ deleteCompany: { params: { id: string }; result: void }
3524
+ // Contact operations
3525
+ createContact: { params: Omit<CreateContactParams, 'organizationId'>; result: AcqContact }
3526
+ upsertContact: { params: Omit<UpsertContactParams, 'organizationId'>; result: AcqContact }
3527
+ updateContact: { params: { id: string } & UpdateContactParams; result: AcqContact }
3528
+ getContact: { params: { id: string }; result: AcqContact | null }
3529
+ getContactByEmail: { params: { email: string }; result: AcqContact | null }
3530
+ listContacts: {
3531
+ params: ContactFilters & { limit?: number; offset?: number }
3532
+ result: PaginatedResult<AcqContact>
3533
+ }
3534
+ deleteContact: { params: { id: string }; result: void }
3535
+ bulkImportContacts: { params: Omit<BulkImportParams, 'organizationId'>; result: BulkImportResult }
3536
+ bulkImportCompanies: {
3537
+ params: Omit<BulkImportCompaniesParams, 'organizationId'>
3538
+ result: BulkImportCompaniesResult
3539
+ }
3540
+ deactivateContactsByCompany: {
3541
+ params: { companyId: string }
3542
+ result: { deactivated: number }
3543
+ }
3544
+ // Deal operations
3545
+ upsertDeal: { params: Omit<UpsertDealParams, 'organizationId'>; result: AcqDeal }
3546
+ getDealByEmail: { params: { email: string }; result: AcqDeal | null }
3547
+ getDealByEnvelopeId: { params: { envelopeId: string }; result: AcqDeal | null }
3548
+ updateDealEnvelopeId: { params: { dealId: string; envelopeId: string }; result: AcqDeal | null }
3549
+ getDealById: { params: Omit<GetDealByIdParams, 'organizationId'>; result: AcqDeal | null }
3550
+ getContactById: { params: Omit<GetContactByIdParams, 'organizationId'>; result: AcqContact | null }
3551
+ getCompanyById: { params: Omit<GetCompanyByIdParams, 'organizationId'>; result: AcqCompany | null }
3552
+ // Deal-sync operations
3553
+ updateDiscoveryData: { params: Omit<UpdateDiscoveryDataParams, 'organizationId'>; result: void }
3554
+ updateProposalData: { params: Omit<UpdateProposalDataParams, 'organizationId'>; result: void }
3555
+ markProposalSent: { params: Omit<MarkProposalSentParams, 'organizationId'>; result: void }
3556
+ markProposalReviewed: { params: Omit<MarkProposalReviewedParams, 'organizationId'>; result: void }
3557
+ updateCloseLostReason: { params: Omit<UpdateCloseLostReasonParams, 'organizationId'>; result: void }
3558
+ updateFees: { params: Omit<UpdateFeesParams, 'organizationId'>; result: void }
3559
+ cacheInstantlyThreadIds: { params: Omit<CacheInstantlyThreadIdsParams, 'organizationId'>; result: void }
3560
+ transitionItem: { params: Omit<TransitionItemParams, 'organizationId'>; result: void }
3561
+ setContactNurture: { params: Omit<SetContactNurtureParams, 'organizationId'>; result: void }
3562
+ cancelSchedulesAndHitlByEmail: {
3563
+ params: Omit<CancelSchedulesAndHitlByEmailParams, 'organizationId'>
3564
+ result: { schedulesCancelled: number; hitlDeleted: number }
3565
+ }
3566
+ cancelHitlByDealId: { params: Omit<CancelHitlByDealIdParams, 'organizationId'>; result: { hitlDeleted: number } }
3567
+ clearDealFields: { params: Omit<ClearDealFieldsParams, 'organizationId'>; result: void }
3568
+ deleteDeal: { params: Omit<DeleteDealParams, 'organizationId'>; result: void }
3569
+ recordDealActivity: {
3570
+ params: Omit<RecordDealActivityParams, 'organizationId'>
3571
+ result: void
3572
+ }
3573
+ // Deal note operations
3574
+ createDealNote: {
3575
+ params: Omit<CreateDealNoteParams, 'organizationId'>
3576
+ result: AcqDealNote
3577
+ }
3578
+ listDealNotes: {
3579
+ params: Omit<ListDealNotesParams, 'organizationId'>
3580
+ result: AcqDealNote[]
3581
+ }
3582
+ // Deal task operations
3583
+ createDealTask: {
3584
+ params: Omit<CreateDealTaskParams, 'organizationId'>
3585
+ result: AcqDealTask
3586
+ }
3587
+ listDealTasks: {
3588
+ params: Omit<ListDealTasksParams, 'organizationId'>
3589
+ result: AcqDealTask[]
3590
+ }
3591
+ listDealTasksDue: {
3592
+ params: Omit<ListDealTasksDueParams, 'organizationId'>
3593
+ result: AcqDealTask[]
3594
+ }
3595
+ completeDealTask: {
3596
+ params: Omit<CompleteDealTaskParams, 'organizationId'>
3597
+ result: AcqDealTask
3598
+ }
3599
+ // Deal query & analytics operations
3600
+ listDeals: { params: DealFilters; result: AcqDeal[] }
3601
+ getDealPipelineAnalytics: { params: { recentLimit?: number }; result: DealPipelineAnalytics }
3602
+ // Enrichment data operations
3603
+ mergeEnrichmentData: {
3604
+ params: { id: string; table: 'acq_companies' | 'acq_contacts'; data: Record<string, unknown> }
3605
+ result: void
3606
+ }
3607
+ // Social monitoring operations
3608
+ upsertSocialPosts: {
3609
+ params: { posts: Omit<UpsertSocialPostParams, 'organizationId'>[] }
3610
+ result: UpsertSocialPostsResult
3611
+ }
3612
+ setDealStateKey: {
3613
+ params: {
3614
+ dealId: string
3615
+ stateKey: string
3616
+ }
3617
+ result: { ok: true }
3618
+ }
3619
+ // CRM workflow helpers
3620
+ transitionDeal: {
3621
+ params: {
3622
+ dealId: string
3623
+ toStage: string
3624
+ toState?: string
3625
+ }
3626
+ result: { deal: AcqDeal }
3627
+ }
3628
+ loadDeal: {
3629
+ params: { dealId: string }
3630
+ result: DealDetail | null
3631
+ }
3801
3632
  }
3802
3633
  ```
3803
3634
 
3804
3635
  ### `ListToolMap`
3805
3636
 
3806
3637
  ```typescript
3807
- export type ListToolMap = {
3808
- getConfig: {
3809
- params: { listId: string }
3810
- result: { scrapingConfig: ScrapingConfig; icp: IcpRubric; pipelineConfig: PipelineConfig }
3811
- }
3812
- recordExecution: {
3813
- params: Omit<RecordListExecutionParams, 'organizationId'>
3814
- result: void
3815
- }
3816
- updateCompanyStage: {
3817
- params: Omit<UpdateCompanyStageParams, 'organizationId'>
3818
- result: void
3819
- }
3820
- updateContactStage: {
3821
- params: Omit<UpdateContactStageParams, 'organizationId'>
3822
- result: void
3823
- }
3824
- listPendingCompanyIds: {
3825
- params: Omit<ListPendingCompanyIdsParams, 'organizationId'>
3826
- result: string[]
3827
- }
3828
- listPendingContactIds: {
3829
- params: Omit<ListPendingContactIdsParams, 'organizationId'>
3830
- result: string[]
3831
- }
3638
+ export type ListToolMap = {
3639
+ getConfig: {
3640
+ params: { listId: string }
3641
+ result: {
3642
+ scrapingConfig: ScrapingConfig
3643
+ icp: IcpRubric
3644
+ pipelineConfig: PipelineConfig & { dataMode: 'mock' | 'live' }
3645
+ }
3646
+ }
3647
+ recordExecution: {
3648
+ params: Omit<RecordListExecutionParams, 'organizationId'>
3649
+ result: void
3650
+ }
3651
+ updateCompanyStage: {
3652
+ params: Omit<UpdateCompanyStageParams, 'organizationId'>
3653
+ result: void
3654
+ }
3655
+ updateContactStage: {
3656
+ params: Omit<UpdateContactStageParams, 'organizationId'>
3657
+ result: void
3658
+ }
3659
+ clearCompanyStages: {
3660
+ params: Omit<ClearCompanyStagesParams, 'organizationId'>
3661
+ result: void
3662
+ }
3663
+ clearContactStages: {
3664
+ params: Omit<ClearContactStagesParams, 'organizationId'>
3665
+ result: void
3666
+ }
3667
+ listPendingCompanyIds: {
3668
+ params: Omit<ListPendingCompanyIdsParams, 'organizationId'>
3669
+ result: string[]
3670
+ }
3671
+ listPendingContactIds: {
3672
+ params: Omit<ListPendingContactIdsParams, 'organizationId'>
3673
+ result: string[]
3674
+ }
3832
3675
  }
3833
3676
  ```
3834
3677
 
@@ -3837,33 +3680,33 @@ export type ListToolMap = {
3837
3680
  ### `KnowledgeLinkSchema`
3838
3681
 
3839
3682
  ```typescript
3840
- export const KnowledgeLinkSchema = z
3841
- .union([CanonicalKnowledgeLinkSchema, LegacyKnowledgeLinkSchema])
3842
- .transform((link) => {
3843
- const target = 'target' in link ? link.target : targetFromNodeId(link.nodeId)
3844
- return {
3845
- target,
3846
- nodeId: nodeIdFromTarget(target)
3847
- }
3683
+ export const KnowledgeLinkSchema = z
3684
+ .union([CanonicalKnowledgeLinkSchema, LegacyKnowledgeLinkSchema])
3685
+ .transform((link) => {
3686
+ const target = 'target' in link ? link.target : targetFromNodeId(link.nodeId)
3687
+ return {
3688
+ target,
3689
+ nodeId: nodeIdFromTarget(target)
3690
+ }
3848
3691
  })
3849
3692
  ```
3850
3693
 
3851
3694
  ### `OrgKnowledgeKindSchema`
3852
3695
 
3853
3696
  ```typescript
3854
- export const OrgKnowledgeKindSchema = z
3855
- .enum(['playbook', 'strategy', 'reference'])
3697
+ export const OrgKnowledgeKindSchema = z
3698
+ .enum(['playbook', 'strategy', 'reference'])
3856
3699
  .meta({ label: 'Knowledge kind', color: 'grape' })
3857
3700
  ```
3858
3701
 
3859
3702
  ### `OrgKnowledgeNodeSchema`
3860
3703
 
3861
3704
  ```typescript
3862
- export const OrgKnowledgeNodeSchema = z.object({
3863
- id: ModelIdSchema,
3864
- kind: OrgKnowledgeKindSchema,
3865
- title: z.string().trim().min(1).max(200),
3866
- summary: z.string().trim().min(1).max(1000),
3705
+ export const OrgKnowledgeNodeSchema = z.object({
3706
+ id: ModelIdSchema,
3707
+ kind: OrgKnowledgeKindSchema,
3708
+ title: z.string().trim().min(1).max(200),
3709
+ summary: z.string().trim().min(1).max(1000),
3867
3710
  icon: IconNameSchema.optional(),
3868
3711
  /** Canonical documentation URL when body content is a local summary. */
3869
3712
  externalUrl: z.string().trim().url().max(500).optional(),
@@ -3871,15 +3714,15 @@ export const OrgKnowledgeNodeSchema = z.object({
3871
3714
  sourceFilePath: z.string().trim().min(1).max(500).optional(),
3872
3715
  /** Raw MDX string. Phase 2 will introduce a structured block format. */
3873
3716
  body: z.string().trim().min(1),
3874
- /**
3875
- * Graph links to other OM nodes this knowledge node governs.
3876
- * Each link emits a `governs` edge: knowledge-node -> target node.
3877
- */
3878
- links: z.array(KnowledgeLinkSchema).default([]),
3879
- /** Role identifiers that own this knowledge node. */
3880
- ownerIds: z.array(RoleIdSchema.meta({ ref: 'role' })).default([]),
3881
- /** ISO date string (YYYY-MM-DD or full ISO 8601) of last meaningful update. */
3882
- updatedAt: z.string().trim().min(1).max(50)
3717
+ /**
3718
+ * Graph links to other OM nodes this knowledge node governs.
3719
+ * Each link emits a `governs` edge: knowledge-node -> target node.
3720
+ */
3721
+ links: z.array(KnowledgeLinkSchema).default([]),
3722
+ /** Role identifiers that own this knowledge node. */
3723
+ ownerIds: z.array(RoleIdSchema.meta({ ref: 'role' })).default([]),
3724
+ /** ISO date string (YYYY-MM-DD or full ISO 8601) of last meaningful update. */
3725
+ updatedAt: z.string().trim().min(1).max(50)
3883
3726
  })
3884
3727
  ```
3885
3728