@elevasis/sdk 1.19.0 → 1.20.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 (56) hide show
  1. package/dist/cli.cjs +1712 -72
  2. package/dist/index.d.ts +659 -5
  3. package/dist/index.js +565 -42
  4. package/dist/node/index.d.ts +1 -0
  5. package/dist/node/index.js +213 -2
  6. package/dist/test-utils/index.d.ts +459 -4
  7. package/dist/test-utils/index.js +509 -37
  8. package/dist/worker/index.js +365 -37
  9. package/package.json +4 -4
  10. package/reference/_navigation.md +2 -1
  11. package/reference/_reference-manifest.json +14 -0
  12. package/reference/claude-config/rules/agent-start-here.md +5 -5
  13. package/reference/claude-config/rules/deployment.md +4 -3
  14. package/reference/claude-config/rules/frontend.md +2 -2
  15. package/reference/claude-config/rules/operations.md +17 -13
  16. package/reference/claude-config/rules/organization-model.md +7 -5
  17. package/reference/claude-config/rules/organization-os.md +13 -11
  18. package/reference/claude-config/rules/ui.md +3 -3
  19. package/reference/claude-config/rules/vibe.md +4 -4
  20. package/reference/claude-config/skills/explore/SKILL.md +4 -4
  21. package/reference/claude-config/skills/knowledge/SKILL.md +8 -8
  22. package/reference/claude-config/skills/knowledge/operations/codify-level-a.md +7 -7
  23. package/reference/claude-config/skills/knowledge/operations/codify-level-b.md +13 -13
  24. package/reference/claude-config/skills/knowledge/operations/customers.md +1 -1
  25. package/reference/claude-config/skills/knowledge/operations/goals.md +1 -1
  26. package/reference/claude-config/skills/knowledge/operations/identity.md +1 -1
  27. package/reference/claude-config/skills/knowledge/operations/offerings.md +1 -1
  28. package/reference/claude-config/skills/knowledge/operations/roles.md +1 -1
  29. package/reference/claude-config/skills/knowledge/operations/techStack.md +19 -91
  30. package/reference/claude-config/skills/project/SKILL.md +73 -13
  31. package/reference/claude-config/skills/save/SKILL.md +5 -5
  32. package/reference/claude-config/skills/tutorial/technical.md +5 -6
  33. package/reference/claude-config/sync-notes/2026-05-07-sdk-changes-release-train.md +34 -0
  34. package/reference/claude-config/sync-notes/2026-05-08-resource-governance-scaffold-guidance.md +38 -0
  35. package/reference/claude-config/sync-notes/2026-05-09-clients-domain.md +32 -0
  36. package/reference/claude-config/sync-notes/2026-05-09-command-system.md +33 -0
  37. package/reference/claude-config/sync-notes/2026-05-09-resource-governance-and-misc.md +69 -0
  38. package/reference/examples/organization-model.ts +17 -5
  39. package/reference/framework/index.mdx +1 -1
  40. package/reference/framework/project-structure.mdx +10 -8
  41. package/reference/packages/core/src/business/README.md +2 -2
  42. package/reference/packages/core/src/organization-model/README.md +10 -3
  43. package/reference/resources/index.mdx +27 -17
  44. package/reference/scaffold/core/organization-model.mdx +33 -14
  45. package/reference/scaffold/operations/workflow-recipes.md +35 -29
  46. package/reference/scaffold/recipes/add-a-feature.md +18 -3
  47. package/reference/scaffold/recipes/add-a-resource.md +50 -10
  48. package/reference/scaffold/recipes/customize-crm-actions.md +12 -6
  49. package/reference/scaffold/recipes/customize-organization-model.md +18 -3
  50. package/reference/scaffold/recipes/extend-crm.md +17 -19
  51. package/reference/scaffold/recipes/extend-lead-gen.md +31 -31
  52. package/reference/scaffold/recipes/index.md +1 -1
  53. package/reference/scaffold/reference/contracts.md +501 -303
  54. package/reference/scaffold/reference/feature-registry.md +1 -1
  55. package/reference/scaffold/reference/glossary.md +8 -3
  56. package/reference/scaffold/ui/recipes.md +21 -6
package/dist/index.js CHANGED
@@ -78,6 +78,7 @@ var ORGANIZATION_MODEL_ICON_TOKENS = [
78
78
  "knowledge.reference",
79
79
  "feature.dashboard",
80
80
  "feature.calendar",
81
+ "feature.business",
81
82
  "feature.sales",
82
83
  "feature.crm",
83
84
  "feature.finance",
@@ -272,6 +273,13 @@ var LEAD_GEN_STAGE_CATALOG = {
272
273
  order: 2,
273
274
  entity: "company"
274
275
  },
276
+ crawled: {
277
+ key: "crawled",
278
+ label: "Websites crawled",
279
+ description: "Company websites have been crawled (e.g. via Apify) and raw page content stored for downstream LLM analysis.",
280
+ order: 2.5,
281
+ entity: "company"
282
+ },
275
283
  extracted: {
276
284
  key: "extracted",
277
285
  label: "Websites analyzed",
@@ -291,7 +299,9 @@ var LEAD_GEN_STAGE_CATALOG = {
291
299
  label: "Decision-makers found",
292
300
  description: "Decision-maker contacts discovered and attached to a qualified company.",
293
301
  order: 6,
294
- entity: "company"
302
+ entity: "company",
303
+ recordEntity: "contact",
304
+ recordStageKey: "discovered"
295
305
  },
296
306
  // Prospecting — contact discovery
297
307
  discovered: {
@@ -329,7 +339,8 @@ var LEAD_GEN_STAGE_CATALOG = {
329
339
  label: "Reviewed and exported",
330
340
  description: "Approved records have been reviewed and exported for handoff.",
331
341
  order: 10,
332
- entity: "contact"
342
+ entity: "company",
343
+ additionalEntities: ["contact"]
333
344
  },
334
345
  interested: {
335
346
  key: "interested",
@@ -341,18 +352,47 @@ var LEAD_GEN_STAGE_CATALOG = {
341
352
  };
342
353
  var ProspectingLifecycleStageSchema = DisplayMetadataSchema.extend({
343
354
  id: ModelIdSchema,
344
- order: z.number().int().min(0)
355
+ order: z.number().min(0)
356
+ });
357
+ var RecordColumnConfigSchema = z.object({
358
+ key: ModelIdSchema,
359
+ label: z.string().trim().min(1).max(120),
360
+ path: z.string().trim().min(1).max(500),
361
+ width: z.union([z.number().positive(), z.string().trim().min(1).max(100)]).optional(),
362
+ renderType: z.enum(["text", "badge", "datetime", "count", "json"]).optional(),
363
+ badgeColor: z.string().trim().min(1).max(40).optional()
364
+ });
365
+ var RecordColumnsConfigSchema = z.object({
366
+ company: z.array(RecordColumnConfigSchema).optional(),
367
+ contact: z.array(RecordColumnConfigSchema).optional()
368
+ }).refine((columns) => Boolean(columns.company?.length || columns.contact?.length), {
369
+ message: "recordColumns must include at least one entity column set"
370
+ });
371
+ var CredentialRequirementSchema = z.object({
372
+ key: ModelIdSchema,
373
+ provider: ModelIdSchema,
374
+ credentialType: z.enum(["api-key", "api-key-secret", "oauth", "webhook-secret"]),
375
+ label: z.string().trim().min(1).max(120),
376
+ required: z.boolean(),
377
+ selectionMode: z.enum(["single", "multiple"]).optional(),
378
+ inputPath: z.string().trim().min(1).max(500),
379
+ verifyOnRun: z.boolean().optional()
345
380
  });
346
381
  var ProspectingBuildTemplateStepSchema = DisplayMetadataSchema.extend({
347
382
  id: ModelIdSchema,
348
383
  primaryEntity: z.enum(["company", "contact"]),
349
384
  outputs: z.array(z.enum(["company", "contact", "export"])).min(1),
350
385
  stageKey: ModelIdSchema,
386
+ recordEntity: z.enum(["company", "contact"]).optional(),
387
+ recordsStageKey: ModelIdSchema.optional(),
388
+ recordSourceStageKey: ModelIdSchema.optional(),
351
389
  dependsOn: z.array(ModelIdSchema).optional(),
352
390
  dependencyMode: z.literal("per-record-eligibility"),
353
391
  capabilityKey: ModelIdSchema,
354
392
  defaultBatchSize: z.number().int().positive(),
355
- maxBatchSize: z.number().int().positive()
393
+ maxBatchSize: z.number().int().positive(),
394
+ recordColumns: RecordColumnsConfigSchema.optional(),
395
+ credentialRequirements: z.array(CredentialRequirementSchema).optional()
356
396
  }).refine((step) => step.defaultBatchSize <= step.maxBatchSize, {
357
397
  message: "defaultBatchSize must be less than or equal to maxBatchSize",
358
398
  path: ["defaultBatchSize"]
@@ -361,6 +401,62 @@ var ProspectingBuildTemplateSchema = DisplayMetadataSchema.extend({
361
401
  id: ModelIdSchema,
362
402
  steps: z.array(ProspectingBuildTemplateStepSchema).min(1)
363
403
  });
404
+ var DTC_RECORD_COLUMNS = {
405
+ populated: {
406
+ company: [
407
+ { key: "name", label: "Company", path: "company.name" },
408
+ { key: "domain", label: "Domain", path: "company.domain" },
409
+ { key: "employee-count", label: "Employees", path: "company.numEmployees", renderType: "count" },
410
+ { key: "apollo-industry", label: "Apollo industry", path: "company.category" },
411
+ { key: "location", label: "Location", path: "company.locationState" }
412
+ ]
413
+ },
414
+ crawled: {
415
+ company: [
416
+ { key: "name", label: "Company", path: "company.name" },
417
+ { key: "domain", label: "Domain", path: "company.domain" },
418
+ { key: "page-count", label: "Pages", path: "company.enrichmentData.websiteCrawl.pageCount", renderType: "count" },
419
+ { key: "crawl-status", label: "Crawl status", path: "processingState.crawled.status", renderType: "badge" }
420
+ ]
421
+ },
422
+ extracted: {
423
+ company: [
424
+ { key: "name", label: "Company", path: "company.name" },
425
+ { key: "domain", label: "Domain", path: "company.domain" },
426
+ { key: "description", label: "Description", path: "company.enrichmentData.websiteCrawl.companyDescription" },
427
+ { key: "services", label: "Services", path: "company.enrichmentData.websiteCrawl.services", renderType: "json" },
428
+ { key: "automation-gaps", label: "Automation gaps", path: "company.enrichmentData.websiteCrawl.automationGaps", renderType: "json" },
429
+ { key: "contact-count", label: "Contacts", path: "company.enrichmentData.websiteCrawl.emailCount", renderType: "count" }
430
+ ]
431
+ },
432
+ qualified: {
433
+ company: [
434
+ { key: "name", label: "Company", path: "company.name" },
435
+ { key: "domain", label: "Domain", path: "company.domain" },
436
+ { key: "score", label: "Score", path: "company.qualificationScore", renderType: "badge", badgeColor: "green" },
437
+ { key: "signals", label: "Signals", path: "company.qualificationSignals", renderType: "json" },
438
+ { key: "disqualified-reason", label: "Disqualified reason", path: "processingState.qualified.data.disqualifiedReason" }
439
+ ]
440
+ },
441
+ decisionMakers: {
442
+ contact: [
443
+ { key: "name", label: "Name", path: "contact.name" },
444
+ { key: "title", label: "Title", path: "contact.title" },
445
+ { key: "email", label: "Email", path: "contact.email" },
446
+ { key: "linkedin", label: "LinkedIn", path: "contact.linkedinUrl" },
447
+ { key: "priority-score", label: "Priority", path: "contact.enrichmentData.apollo.priorityScore", renderType: "badge" }
448
+ ]
449
+ },
450
+ uploaded: {
451
+ company: [
452
+ { key: "name", label: "Company", path: "company.name" },
453
+ { key: "domain", label: "Domain", path: "company.domain" },
454
+ { key: "contacts", label: "Contacts", path: "company.enrichmentData.approvedLeadListExport.contacts", renderType: "json" },
455
+ { key: "score", label: "Score", path: "company.qualificationScore", renderType: "badge", badgeColor: "green" },
456
+ { key: "approval", label: "Approval", path: "company.enrichmentData.approvedLeadListExport.approvalStatus", renderType: "badge" }
457
+ ]
458
+ }
459
+ };
364
460
  z.object({
365
461
  id: ModelIdSchema,
366
462
  label: z.string(),
@@ -392,6 +488,12 @@ var CAPABILITY_REGISTRY = [
392
488
  description: "Check email deliverability before outreach.",
393
489
  resourceId: "lgn-05-email-verification-workflow"
394
490
  },
491
+ {
492
+ id: "lead-gen.company.apify-crawl",
493
+ label: "Crawl websites",
494
+ description: "Crawl company websites via Apify and store raw page markdown in enrichmentData.websiteCrawl.pages for downstream LLM analysis.",
495
+ resourceId: "lgn-02a-apify-website-crawl-workflow"
496
+ },
395
497
  {
396
498
  id: "lead-gen.company.website-extract",
397
499
  label: "Extract website signals",
@@ -538,7 +640,45 @@ var PROSPECTING_STEPS = {
538
640
  dependencyMode: "per-record-eligibility",
539
641
  capabilityKey: "lead-gen.company.apollo-import",
540
642
  defaultBatchSize: 250,
541
- maxBatchSize: 1e3
643
+ maxBatchSize: 1e3,
644
+ recordColumns: DTC_RECORD_COLUMNS.populated,
645
+ credentialRequirements: [
646
+ {
647
+ key: "apollo",
648
+ provider: "apollo",
649
+ credentialType: "api-key-secret",
650
+ label: "Apollo API key",
651
+ required: true,
652
+ selectionMode: "single",
653
+ inputPath: "credential"
654
+ }
655
+ ]
656
+ },
657
+ apifyCrawl: {
658
+ id: "apify-crawl",
659
+ label: "Websites crawled",
660
+ description: "Crawl company websites via Apify and store raw page markdown in enrichmentData.websiteCrawl.pages for downstream LLM analysis. Overwrites the synthetic seed Apollo Import wrote with real page content.",
661
+ primaryEntity: "company",
662
+ outputs: ["company"],
663
+ stageKey: "crawled",
664
+ dependsOn: ["import-apollo-search"],
665
+ dependencyMode: "per-record-eligibility",
666
+ capabilityKey: "lead-gen.company.apify-crawl",
667
+ defaultBatchSize: 50,
668
+ maxBatchSize: 100,
669
+ recordColumns: DTC_RECORD_COLUMNS.crawled,
670
+ credentialRequirements: [
671
+ {
672
+ key: "apify",
673
+ provider: "apify",
674
+ credentialType: "api-key-secret",
675
+ label: "Apify API token",
676
+ required: true,
677
+ selectionMode: "single",
678
+ inputPath: "credential",
679
+ verifyOnRun: true
680
+ }
681
+ ]
542
682
  },
543
683
  analyzeWebsites: {
544
684
  id: "analyze-websites",
@@ -547,11 +687,12 @@ var PROSPECTING_STEPS = {
547
687
  primaryEntity: "company",
548
688
  outputs: ["company"],
549
689
  stageKey: "extracted",
550
- dependsOn: ["import-apollo-search"],
690
+ dependsOn: ["apify-crawl"],
551
691
  dependencyMode: "per-record-eligibility",
552
692
  capabilityKey: "lead-gen.company.website-extract",
553
693
  defaultBatchSize: 50,
554
- maxBatchSize: 100
694
+ maxBatchSize: 100,
695
+ recordColumns: DTC_RECORD_COLUMNS.extracted
555
696
  },
556
697
  scoreDtcFit: {
557
698
  id: "score-dtc-fit",
@@ -564,7 +705,8 @@ var PROSPECTING_STEPS = {
564
705
  dependencyMode: "per-record-eligibility",
565
706
  capabilityKey: "lead-gen.company.dtc-subscription-qualify",
566
707
  defaultBatchSize: 100,
567
- maxBatchSize: 250
708
+ maxBatchSize: 250,
709
+ recordColumns: DTC_RECORD_COLUMNS.qualified
568
710
  },
569
711
  enrichDecisionMakers: {
570
712
  id: "enrich-decision-makers",
@@ -573,37 +715,52 @@ var PROSPECTING_STEPS = {
573
715
  primaryEntity: "company",
574
716
  outputs: ["contact"],
575
717
  stageKey: "decision-makers-enriched",
718
+ recordEntity: "contact",
576
719
  dependsOn: ["score-dtc-fit"],
577
720
  dependencyMode: "per-record-eligibility",
578
721
  capabilityKey: "lead-gen.contact.apollo-decision-maker-enrich",
579
722
  defaultBatchSize: 100,
580
- maxBatchSize: 250
581
- },
582
- verifyEmails: {
583
- id: "verify-emails",
584
- label: "Emails verified",
585
- description: "Verify deliverability before the QC and handoff step.",
586
- primaryEntity: "contact",
587
- outputs: ["contact"],
588
- stageKey: "verified",
589
- dependsOn: ["enrich-decision-makers"],
590
- dependencyMode: "per-record-eligibility",
591
- capabilityKey: "lead-gen.contact.verify-email",
592
- defaultBatchSize: 250,
593
- maxBatchSize: 500
723
+ maxBatchSize: 250,
724
+ recordColumns: DTC_RECORD_COLUMNS.decisionMakers,
725
+ credentialRequirements: [
726
+ {
727
+ key: "apollo",
728
+ provider: "apollo",
729
+ credentialType: "api-key-secret",
730
+ label: "Apollo API key",
731
+ required: true,
732
+ selectionMode: "single",
733
+ inputPath: "credential"
734
+ }
735
+ ]
594
736
  },
595
737
  reviewAndExport: {
596
738
  id: "review-and-export",
597
739
  label: "Reviewed and exported",
598
- description: "Operator QC approves or rejects leads, then approved records are exported as a lead list.",
740
+ description: "Operator QC approves or rejects qualified companies, then approved records are exported as a lead list with unverified emails.",
599
741
  primaryEntity: "company",
600
742
  outputs: ["export"],
601
743
  stageKey: "uploaded",
602
- dependsOn: ["verify-emails"],
744
+ recordsStageKey: "uploaded",
745
+ recordSourceStageKey: "qualified",
746
+ dependsOn: ["enrich-decision-makers"],
603
747
  dependencyMode: "per-record-eligibility",
604
748
  capabilityKey: "lead-gen.export.list",
605
749
  defaultBatchSize: 100,
606
- maxBatchSize: 250
750
+ maxBatchSize: 250,
751
+ recordColumns: DTC_RECORD_COLUMNS.uploaded,
752
+ credentialRequirements: [
753
+ {
754
+ key: "clickup",
755
+ provider: "clickup",
756
+ credentialType: "api-key-secret",
757
+ label: "ClickUp API token",
758
+ required: true,
759
+ selectionMode: "single",
760
+ inputPath: "clickupCredential",
761
+ verifyOnRun: true
762
+ }
763
+ ]
607
764
  }
608
765
  }
609
766
  };
@@ -625,7 +782,7 @@ function toProspectingLifecycleStage(stage) {
625
782
  };
626
783
  }
627
784
  function leadGenStagesForEntity(entity) {
628
- return Object.values(LEAD_GEN_STAGE_CATALOG).filter((stage) => stage.entity === entity).sort((a, b) => a.order - b.order).map(toProspectingLifecycleStage);
785
+ return Object.values(LEAD_GEN_STAGE_CATALOG).filter((stage) => stage.entity === entity || stage.additionalEntities?.includes(entity)).sort((a, b) => a.order - b.order).map(toProspectingLifecycleStage);
629
786
  }
630
787
  var DEFAULT_ORGANIZATION_MODEL_PROSPECTING = {
631
788
  companyStages: leadGenStagesForEntity("company"),
@@ -651,10 +808,10 @@ var DEFAULT_ORGANIZATION_MODEL_PROSPECTING = {
651
808
  description: "Prospecting pipeline for DTC subscription or subscription-ready brands where Apollo is the source and contact-enrichment layer, Elevasis handles company research and fit scoring, and approved leads export as an approved lead list.",
652
809
  steps: [
653
810
  PROSPECTING_STEPS.dtcApolloClickup.importApolloSearch,
811
+ PROSPECTING_STEPS.dtcApolloClickup.apifyCrawl,
654
812
  PROSPECTING_STEPS.dtcApolloClickup.analyzeWebsites,
655
813
  PROSPECTING_STEPS.dtcApolloClickup.scoreDtcFit,
656
814
  PROSPECTING_STEPS.dtcApolloClickup.enrichDecisionMakers,
657
- PROSPECTING_STEPS.dtcApolloClickup.verifyEmails,
658
815
  PROSPECTING_STEPS.dtcApolloClickup.reviewAndExport
659
816
  ]
660
817
  }
@@ -929,6 +1086,149 @@ var RegistryValidationError = class extends Error {
929
1086
  this.name = "RegistryValidationError";
930
1087
  }
931
1088
  };
1089
+ function getResourceValidatorMode(explicitMode) {
1090
+ if (explicitMode) return explicitMode;
1091
+ const env = globalThis.process?.env;
1092
+ return env?.ELEVASIS_RESOURCE_VALIDATOR === "warn-only" ? "warn-only" : "strict";
1093
+ }
1094
+ function addGovernanceIssue(issues, type, orgName, resourceId, message) {
1095
+ issues.push({
1096
+ type,
1097
+ orgName,
1098
+ resourceId,
1099
+ message
1100
+ });
1101
+ }
1102
+ function emitGovernanceIssues(issues, mode, onWarning) {
1103
+ if (issues.length === 0) return;
1104
+ if (mode === "strict") {
1105
+ const first = issues[0];
1106
+ throw new RegistryValidationError(first.orgName, first.resourceId, "organizationModel.resources", first.message);
1107
+ }
1108
+ const warn = onWarning ?? ((issue) => console.warn(issue.message));
1109
+ for (const issue of issues) {
1110
+ warn(issue);
1111
+ }
1112
+ }
1113
+ function getRuntimeResources(resources) {
1114
+ return [
1115
+ ...(resources.workflows ?? []).map((workflow) => ({
1116
+ resourceId: workflow.config.resourceId,
1117
+ type: workflow.config.type,
1118
+ descriptor: workflow.config.resource
1119
+ })),
1120
+ ...(resources.agents ?? []).map((agent) => ({
1121
+ resourceId: agent.config.resourceId,
1122
+ type: agent.config.type,
1123
+ descriptor: agent.config.resource
1124
+ })),
1125
+ ...(resources.integrations ?? []).map((integration) => ({
1126
+ resourceId: integration.resourceId,
1127
+ type: integration.type,
1128
+ descriptor: integration.resource
1129
+ }))
1130
+ ];
1131
+ }
1132
+ function validateResourceGovernance(orgName, deployment, organizationModel = deployment.organizationModel, options = {}) {
1133
+ const mode = getResourceValidatorMode(options.mode);
1134
+ const omResources = organizationModel?.resources?.entries;
1135
+ const omSystems = organizationModel?.systems?.systems;
1136
+ const issues = [];
1137
+ if (!omResources || !omSystems) {
1138
+ return { valid: true, mode, issues };
1139
+ }
1140
+ const systemsById = new Map(omSystems.map((system) => [system.id, system]));
1141
+ const activeOmResources = omResources.filter((resource) => resource.status === "active");
1142
+ const omResourcesById = new Map(activeOmResources.map((resource) => [resource.id, resource]));
1143
+ const runtimeResources = getRuntimeResources(deployment);
1144
+ const runtimeResourcesById = new Map(runtimeResources.map((resource) => [resource.resourceId, resource]));
1145
+ for (const resource of activeOmResources) {
1146
+ if (!systemsById.has(resource.systemId)) {
1147
+ addGovernanceIssue(
1148
+ issues,
1149
+ "missing-om-system",
1150
+ orgName,
1151
+ resource.id,
1152
+ `[${orgName}] OM resource '${resource.id}' references missing System '${resource.systemId}'.`
1153
+ );
1154
+ }
1155
+ const runtimeResource = runtimeResourcesById.get(resource.id);
1156
+ if (!runtimeResource) {
1157
+ addGovernanceIssue(
1158
+ issues,
1159
+ "missing-code-resource",
1160
+ orgName,
1161
+ resource.id,
1162
+ `[${orgName}] OM resource '${resource.id}' has no matching code-side resource.`
1163
+ );
1164
+ continue;
1165
+ }
1166
+ if (runtimeResource.type !== resource.kind) {
1167
+ addGovernanceIssue(
1168
+ issues,
1169
+ "type-mismatch",
1170
+ orgName,
1171
+ resource.id,
1172
+ `[${orgName}] Resource '${resource.id}' type mismatch: code has '${runtimeResource.type}', OM has '${resource.kind}'.`
1173
+ );
1174
+ }
1175
+ if (runtimeResource.descriptor && runtimeResource.descriptor.systemId !== resource.systemId) {
1176
+ addGovernanceIssue(
1177
+ issues,
1178
+ "system-mismatch",
1179
+ orgName,
1180
+ resource.id,
1181
+ `[${orgName}] Resource '${resource.id}' system mismatch: code descriptor has '${runtimeResource.descriptor.systemId}', OM has '${resource.systemId}'.`
1182
+ );
1183
+ }
1184
+ }
1185
+ for (const runtimeResource of runtimeResources) {
1186
+ const omResource = omResourcesById.get(runtimeResource.resourceId);
1187
+ if (!omResource) {
1188
+ addGovernanceIssue(
1189
+ issues,
1190
+ "missing-om-resource",
1191
+ orgName,
1192
+ runtimeResource.resourceId,
1193
+ `[${orgName}] Code-side resource '${runtimeResource.resourceId}' has no active OM Resource descriptor.`
1194
+ );
1195
+ }
1196
+ if (!runtimeResource.descriptor) {
1197
+ addGovernanceIssue(
1198
+ issues,
1199
+ "raw-resource-id",
1200
+ orgName,
1201
+ runtimeResource.resourceId,
1202
+ `[${orgName}] Code-side resource '${runtimeResource.resourceId}' authors raw resourceId/type values. Use an OM Resource descriptor and bindResourceDescriptor().`
1203
+ );
1204
+ continue;
1205
+ }
1206
+ if (runtimeResource.descriptor.id !== runtimeResource.resourceId) {
1207
+ addGovernanceIssue(
1208
+ issues,
1209
+ "raw-resource-id",
1210
+ orgName,
1211
+ runtimeResource.resourceId,
1212
+ `[${orgName}] Code-side resource '${runtimeResource.resourceId}' does not derive identity from its OM descriptor '${runtimeResource.descriptor.id}'.`
1213
+ );
1214
+ }
1215
+ if (runtimeResource.descriptor.kind !== runtimeResource.type) {
1216
+ addGovernanceIssue(
1217
+ issues,
1218
+ "type-mismatch",
1219
+ orgName,
1220
+ runtimeResource.resourceId,
1221
+ `[${orgName}] Code-side resource '${runtimeResource.resourceId}' descriptor kind '${runtimeResource.descriptor.kind}' does not match runtime type '${runtimeResource.type}'.`
1222
+ );
1223
+ }
1224
+ }
1225
+ emitGovernanceIssues(issues, mode, options.onWarning);
1226
+ return {
1227
+ valid: issues.length === 0,
1228
+ mode,
1229
+ issues
1230
+ };
1231
+ }
932
1232
  function validateDeploymentSpec(orgName, resources) {
933
1233
  const seenIds = /* @__PURE__ */ new Set();
934
1234
  resources.workflows?.forEach((workflow) => {
@@ -965,6 +1265,7 @@ function validateDeploymentSpec(orgName, resources) {
965
1265
  validateExecutionInterface(orgName, id, agent.interface, agent.contract.inputSchema);
966
1266
  }
967
1267
  });
1268
+ validateResourceGovernance(orgName, resources);
968
1269
  }
969
1270
  function validateResourceModelConfig(orgName, resourceId, modelConfig) {
970
1271
  try {
@@ -3448,6 +3749,29 @@ function redactSecret(value) {
3448
3749
  }
3449
3750
 
3450
3751
  // ../core/src/platform/registry/serialization.ts
3752
+ function summarizeSystem(system) {
3753
+ if (!system) return void 0;
3754
+ return {
3755
+ id: system.id,
3756
+ title: system.title,
3757
+ description: system.description,
3758
+ kind: system.kind,
3759
+ status: system.status
3760
+ };
3761
+ }
3762
+ function createGovernanceMetadataResolver(resources) {
3763
+ const resourcesById = new Map((resources.organizationModel?.resources?.entries ?? []).map((r) => [r.id, r]));
3764
+ const systemsById = new Map((resources.organizationModel?.systems?.systems ?? []).map((s) => [s.id, s]));
3765
+ return (resourceId, descriptor) => {
3766
+ const resource = descriptor ?? resourcesById.get(resourceId);
3767
+ if (!resource) return {};
3768
+ return {
3769
+ systemId: resource.systemId,
3770
+ system: summarizeSystem(systemsById.get(resource.systemId)),
3771
+ governanceStatus: resource.status
3772
+ };
3773
+ };
3774
+ }
3451
3775
  function serializeAllOrganizations(registry) {
3452
3776
  const cache = /* @__PURE__ */ new Map();
3453
3777
  for (const [orgName, resources] of Object.entries(registry)) {
@@ -3456,6 +3780,7 @@ function serializeAllOrganizations(registry) {
3456
3780
  return cache;
3457
3781
  }
3458
3782
  function serializeOrganization(resources) {
3783
+ const getGovernanceMetadata = createGovernanceMetadataResolver(resources);
3459
3784
  const workflowDefinitions = /* @__PURE__ */ new Map();
3460
3785
  const workflowResources = [];
3461
3786
  const commandViewWorkflows = [];
@@ -3471,7 +3796,8 @@ function serializeOrganization(resources) {
3471
3796
  type: "workflow",
3472
3797
  status: workflow.config.status,
3473
3798
  links: workflow.config.links,
3474
- category: workflow.config.category
3799
+ category: workflow.config.category,
3800
+ ...getGovernanceMetadata(resourceId, workflow.config.resource)
3475
3801
  });
3476
3802
  commandViewWorkflows.push({
3477
3803
  resourceId,
@@ -3482,6 +3808,7 @@ function serializeOrganization(resources) {
3482
3808
  status: workflow.config.status,
3483
3809
  links: workflow.config.links,
3484
3810
  category: workflow.config.category,
3811
+ ...getGovernanceMetadata(resourceId, workflow.config.resource),
3485
3812
  stepCount: Object.keys(workflow.steps).length,
3486
3813
  entryPoint: workflow.entryPoint
3487
3814
  });
@@ -3501,7 +3828,8 @@ function serializeOrganization(resources) {
3501
3828
  type: "agent",
3502
3829
  status: agent.config.status,
3503
3830
  links: agent.config.links,
3504
- category: agent.config.category
3831
+ category: agent.config.category,
3832
+ ...getGovernanceMetadata(resourceId, agent.config.resource)
3505
3833
  });
3506
3834
  commandViewAgents.push({
3507
3835
  resourceId,
@@ -3512,6 +3840,7 @@ function serializeOrganization(resources) {
3512
3840
  status: agent.config.status,
3513
3841
  links: agent.config.links,
3514
3842
  category: agent.config.category,
3843
+ ...getGovernanceMetadata(resourceId, agent.config.resource),
3515
3844
  modelProvider: agent.modelConfig.provider,
3516
3845
  modelId: agent.modelConfig.model,
3517
3846
  toolCount: agent.tools.length,
@@ -3656,6 +3985,16 @@ function filterArchived(org) {
3656
3985
  humanCheckpoints: org.humanCheckpoints?.filter((h) => !h.archived)
3657
3986
  };
3658
3987
  }
3988
+ function summarizeSystem2(system) {
3989
+ if (!system) return void 0;
3990
+ return {
3991
+ id: system.id,
3992
+ title: system.title,
3993
+ description: system.description,
3994
+ kind: system.kind,
3995
+ status: system.status
3996
+ };
3997
+ }
3659
3998
  var ResourceRegistry = class {
3660
3999
  constructor(registry) {
3661
4000
  this.registry = registry;
@@ -3802,6 +4141,17 @@ var ResourceRegistry = class {
3802
4141
  environment
3803
4142
  };
3804
4143
  }
4144
+ const resourcesById = new Map((orgResources.organizationModel?.resources?.entries ?? []).map((r) => [r.id, r]));
4145
+ const systemsById = new Map((orgResources.organizationModel?.systems?.systems ?? []).map((s) => [s.id, s]));
4146
+ const getGovernanceMetadata = (resourceId, descriptor) => {
4147
+ const resource = descriptor ?? resourcesById.get(resourceId);
4148
+ if (!resource) return {};
4149
+ return {
4150
+ systemId: resource.systemId,
4151
+ system: summarizeSystem2(systemsById.get(resource.systemId)),
4152
+ governanceStatus: resource.status
4153
+ };
4154
+ };
3805
4155
  const workflows = (orgResources.workflows || []).map((def) => ({
3806
4156
  resourceId: def.config.resourceId,
3807
4157
  name: def.config.name,
@@ -3811,7 +4161,8 @@ var ResourceRegistry = class {
3811
4161
  status: def.config.status,
3812
4162
  links: def.config.links,
3813
4163
  category: def.config.category,
3814
- origin: this.remoteResources.has(`${organizationName}/${def.config.resourceId}`) ? "remote" : "local"
4164
+ origin: this.remoteResources.has(`${organizationName}/${def.config.resourceId}`) ? "remote" : "local",
4165
+ ...getGovernanceMetadata(def.config.resourceId, def.config.resource)
3815
4166
  })).filter((resource) => !environment || resource.status === environment);
3816
4167
  const agents = (orgResources.agents || []).map((def) => ({
3817
4168
  resourceId: def.config.resourceId,
@@ -3823,7 +4174,8 @@ var ResourceRegistry = class {
3823
4174
  links: def.config.links,
3824
4175
  category: def.config.category,
3825
4176
  sessionCapable: def.config.sessionCapable ?? false,
3826
- origin: this.remoteResources.has(`${organizationName}/${def.config.resourceId}`) ? "remote" : "local"
4177
+ origin: this.remoteResources.has(`${organizationName}/${def.config.resourceId}`) ? "remote" : "local",
4178
+ ...getGovernanceMetadata(def.config.resourceId, def.config.resource)
3827
4179
  })).filter((resource) => !environment || resource.status === environment);
3828
4180
  return {
3829
4181
  workflows,
@@ -4346,6 +4698,9 @@ z.object({
4346
4698
  });
4347
4699
  z.object({
4348
4700
  stage: DealStageSchema.optional(),
4701
+ list: UuidSchema.optional(),
4702
+ batch: z.string().trim().min(1).max(255).optional(),
4703
+ staleSince: z.string().datetime().optional(),
4349
4704
  search: z.string().optional(),
4350
4705
  limit: z.coerce.number().int().positive().default(50),
4351
4706
  offset: z.coerce.number().int().min(0).default(0)
@@ -4428,6 +4783,7 @@ var DealListItemSchema = z.object({
4428
4783
  // acq_deals columns
4429
4784
  id: z.string(),
4430
4785
  organization_id: z.string(),
4786
+ client_id: z.string().nullable().optional(),
4431
4787
  contact_id: z.string().nullable(),
4432
4788
  contact_email: z.string(),
4433
4789
  pipeline_key: z.string(),
@@ -4508,8 +4864,31 @@ var ConversationMessageSchema = z.object({
4508
4864
  var DealConversationSchema = z.object({
4509
4865
  messages: z.array(ConversationMessageSchema)
4510
4866
  });
4867
+ var DealLineageListRefSchema = z.object({
4868
+ id: z.string(),
4869
+ name: z.string(),
4870
+ status: z.string()
4871
+ });
4872
+ var DealLineageProjectRefSchema = z.object({
4873
+ id: z.string(),
4874
+ name: z.string(),
4875
+ kind: z.string(),
4876
+ status: z.string(),
4877
+ updatedAt: z.string()
4878
+ });
4879
+ var DealLineageClientRefSchema = z.object({
4880
+ id: z.string(),
4881
+ name: z.string(),
4882
+ status: z.string()
4883
+ });
4884
+ var DealLineageSchema = z.object({
4885
+ list: DealLineageListRefSchema.nullable(),
4886
+ projects: z.array(DealLineageProjectRefSchema),
4887
+ client: DealLineageClientRefSchema.nullable()
4888
+ });
4511
4889
  DealListItemSchema.extend({
4512
- conversation: DealConversationSchema
4890
+ conversation: DealConversationSchema,
4891
+ lineage: DealLineageSchema.optional()
4513
4892
  });
4514
4893
  var DealNoteResponseSchema = z.object({
4515
4894
  id: z.string(),
@@ -4570,11 +4949,19 @@ var BuildPlanSnapshotStepSchema = z.object({
4570
4949
  primaryEntity: z.enum(["company", "contact"]),
4571
4950
  outputs: z.array(z.enum(["company", "contact", "export"])).min(1),
4572
4951
  stageKey: LeadGenStageKeySchema,
4952
+ recordEntity: z.enum(["company", "contact"]).optional(),
4953
+ recordsStageKey: LeadGenStageKeySchema.optional(),
4954
+ recordSourceStageKey: LeadGenStageKeySchema.optional(),
4573
4955
  dependsOn: z.array(z.string().trim().min(1).max(100)).optional(),
4574
4956
  dependencyMode: z.literal("per-record-eligibility"),
4575
4957
  capabilityKey: LeadGenCapabilityKeySchema,
4576
4958
  defaultBatchSize: z.number().int().positive(),
4577
- maxBatchSize: z.number().int().positive()
4959
+ maxBatchSize: z.number().int().positive(),
4960
+ recordColumns: z.object({
4961
+ company: z.array(RecordColumnConfigSchema).optional(),
4962
+ contact: z.array(RecordColumnConfigSchema).optional()
4963
+ }).optional(),
4964
+ credentialRequirements: z.array(CredentialRequirementSchema).optional()
4578
4965
  }).refine((step) => step.defaultBatchSize <= step.maxBatchSize, {
4579
4966
  message: "defaultBatchSize must be less than or equal to maxBatchSize",
4580
4967
  path: ["defaultBatchSize"]
@@ -4713,6 +5100,23 @@ var AcqListResponseSchema = z.object({
4713
5100
  });
4714
5101
  z.array(AcqListResponseSchema);
4715
5102
  z.array(ListTelemetrySchema);
5103
+ var QueryBooleanSchema = z.preprocess((value) => {
5104
+ if (value === "true" || value === "1" || value === true) return true;
5105
+ if (value === "false" || value === "0" || value === false) return false;
5106
+ return value;
5107
+ }, z.boolean());
5108
+ z.object({
5109
+ status: ListStatusSchema.optional(),
5110
+ batch: z.string().trim().min(1).max(255).optional(),
5111
+ vertical: z.string().trim().min(1).max(255).optional(),
5112
+ limit: z.coerce.number().int().min(1).max(500).optional(),
5113
+ offset: z.coerce.number().int().min(0).optional()
5114
+ }).strict();
5115
+ z.object({
5116
+ includeDeals: QueryBooleanSchema.default(true),
5117
+ includeProgress: QueryBooleanSchema.default(false),
5118
+ dealLimit: z.coerce.number().int().min(0).max(100).default(25)
5119
+ }).strict();
4716
5120
  var ListStageProgressSchema = z.object({
4717
5121
  total: z.number().int().min(0),
4718
5122
  attempted: z.number().int().min(0),
@@ -4723,12 +5127,48 @@ var ListStageProgressSchema = z.object({
4723
5127
  other: z.number().int().min(0),
4724
5128
  notAttempted: z.number().int().min(0)
4725
5129
  });
4726
- z.object({
5130
+ var ListProgressResponseSchema = z.object({
4727
5131
  totalMembers: z.number().int().min(0),
4728
5132
  totalCompanies: z.number().int().min(0),
4729
5133
  byCompanyStage: z.record(z.string(), ListStageProgressSchema),
4730
5134
  byContactStage: z.record(z.string(), ListStageProgressSchema)
4731
5135
  });
5136
+ var AcqListDealRefSchema = z.object({
5137
+ id: z.string(),
5138
+ contactEmail: z.string(),
5139
+ stageKey: z.string().nullable(),
5140
+ stateKey: z.string().nullable(),
5141
+ sourceType: z.string().nullable(),
5142
+ lastActivityAt: z.string()
5143
+ });
5144
+ var AcqListLineageSchema = z.object({
5145
+ deals: z.object({
5146
+ total: z.number().int().min(0),
5147
+ refs: z.array(AcqListDealRefSchema),
5148
+ truncated: z.boolean()
5149
+ })
5150
+ });
5151
+ AcqListResponseSchema.extend({
5152
+ lineage: AcqListLineageSchema.optional(),
5153
+ progress: ListProgressResponseSchema.optional()
5154
+ });
5155
+ var AcqListStatusListItemSchema = z.object({
5156
+ listId: z.string(),
5157
+ name: z.string(),
5158
+ status: ListStatusSchema,
5159
+ totalCompanies: z.number().int().min(0),
5160
+ totalContacts: z.number().int().min(0),
5161
+ totalDeals: z.number().int().min(0),
5162
+ createdAt: z.string()
5163
+ });
5164
+ z.object({
5165
+ totalLists: z.number().int().min(0),
5166
+ totalCompanies: z.number().int().min(0),
5167
+ totalContacts: z.number().int().min(0),
5168
+ totalDeals: z.number().int().min(0),
5169
+ byStatus: z.record(z.string(), z.number().int().min(0)),
5170
+ lists: z.array(AcqListStatusListItemSchema)
5171
+ });
4732
5172
  var ListExecutionSummarySchema = z.object({
4733
5173
  executionId: z.string(),
4734
5174
  resourceId: z.string(),
@@ -4739,11 +5179,6 @@ var ListExecutionSummarySchema = z.object({
4739
5179
  input: z.unknown().nullable().optional()
4740
5180
  });
4741
5181
  z.array(ListExecutionSummarySchema);
4742
- var QueryBooleanSchema = z.preprocess((value) => {
4743
- if (value === "true" || value === "1" || value === true) return true;
4744
- if (value === "false" || value === "0" || value === false) return false;
4745
- return value;
4746
- }, z.boolean());
4747
5182
  var AcqCompanyStatusSchema = z.enum(["active", "invalid"]);
4748
5183
  var AcqContactStatusSchema = z.enum(["active", "invalid"]);
4749
5184
  var AcqEmailValidSchema = z.enum(["VALID", "INVALID", "RISKY", "UNKNOWN"]);
@@ -4778,6 +5213,7 @@ z.object({
4778
5213
  }).strict();
4779
5214
  z.object({
4780
5215
  name: z.string().trim().min(1).max(255),
5216
+ clientId: UuidSchema.nullable().optional(),
4781
5217
  domain: z.string().trim().min(1).max(255).optional(),
4782
5218
  linkedinUrl: z.string().trim().url().optional(),
4783
5219
  website: z.string().trim().url().optional(),
@@ -4793,6 +5229,7 @@ z.object({
4793
5229
  }).strict();
4794
5230
  z.object({
4795
5231
  name: z.string().trim().min(1).max(255).optional(),
5232
+ clientId: UuidSchema.nullable().optional(),
4796
5233
  domain: z.string().trim().min(1).max(255).optional(),
4797
5234
  linkedinUrl: z.string().trim().url().optional(),
4798
5235
  website: z.string().trim().url().optional(),
@@ -4810,13 +5247,14 @@ z.object({
4810
5247
  status: AcqCompanyStatusSchema.optional(),
4811
5248
  verticalResearch: z.string().trim().min(1).max(5e3).nullable().optional()
4812
5249
  }).strict().refine(
4813
- (data) => data.name !== void 0 || data.domain !== void 0 || data.linkedinUrl !== void 0 || data.website !== void 0 || data.numEmployees !== void 0 || data.foundedYear !== void 0 || data.locationCity !== void 0 || data.locationState !== void 0 || data.category !== void 0 || data.segment !== void 0 || data.processingState !== void 0 || data.pipelineStatus !== void 0 || data.enrichmentData !== void 0 || data.source !== void 0 || data.batchId !== void 0 || data.status !== void 0 || data.verticalResearch !== void 0,
5250
+ (data) => data.name !== void 0 || data.clientId !== void 0 || data.domain !== void 0 || data.linkedinUrl !== void 0 || data.website !== void 0 || data.numEmployees !== void 0 || data.foundedYear !== void 0 || data.locationCity !== void 0 || data.locationState !== void 0 || data.category !== void 0 || data.segment !== void 0 || data.processingState !== void 0 || data.pipelineStatus !== void 0 || data.enrichmentData !== void 0 || data.source !== void 0 || data.batchId !== void 0 || data.status !== void 0 || data.verticalResearch !== void 0,
4814
5251
  {
4815
5252
  message: "At least one field must be provided"
4816
5253
  }
4817
5254
  );
4818
5255
  z.object({
4819
5256
  email: z.string().trim().email(),
5257
+ clientId: UuidSchema.nullable().optional(),
4820
5258
  companyId: UuidSchema.optional(),
4821
5259
  firstName: z.string().trim().min(1).max(255).optional(),
4822
5260
  lastName: z.string().trim().min(1).max(255).optional(),
@@ -4829,6 +5267,7 @@ z.object({
4829
5267
  }).strict();
4830
5268
  z.object({
4831
5269
  companyId: UuidSchema.optional(),
5270
+ clientId: UuidSchema.nullable().optional(),
4832
5271
  emailValid: AcqEmailValidSchema.optional(),
4833
5272
  firstName: z.string().trim().min(1).max(255).optional(),
4834
5273
  lastName: z.string().trim().min(1).max(255).optional(),
@@ -4842,7 +5281,7 @@ z.object({
4842
5281
  enrichmentData: z.record(z.string(), z.unknown()).optional(),
4843
5282
  status: AcqContactStatusSchema.optional()
4844
5283
  }).strict().refine(
4845
- (data) => data.companyId !== void 0 || data.emailValid !== void 0 || data.firstName !== void 0 || data.lastName !== void 0 || data.linkedinUrl !== void 0 || data.title !== void 0 || data.headline !== void 0 || data.filterReason !== void 0 || data.openingLine !== void 0 || data.processingState !== void 0 || data.pipelineStatus !== void 0 || data.enrichmentData !== void 0 || data.status !== void 0,
5284
+ (data) => data.companyId !== void 0 || data.clientId !== void 0 || data.emailValid !== void 0 || data.firstName !== void 0 || data.lastName !== void 0 || data.linkedinUrl !== void 0 || data.title !== void 0 || data.headline !== void 0 || data.filterReason !== void 0 || data.openingLine !== void 0 || data.processingState !== void 0 || data.pipelineStatus !== void 0 || data.enrichmentData !== void 0 || data.status !== void 0,
4846
5285
  {
4847
5286
  message: "At least one field must be provided"
4848
5287
  }
@@ -4850,6 +5289,7 @@ z.object({
4850
5289
  var AcqCompanyResponseSchema = z.object({
4851
5290
  id: z.string(),
4852
5291
  organizationId: z.string(),
5292
+ clientId: z.string().nullable().optional(),
4853
5293
  name: z.string(),
4854
5294
  domain: z.string().nullable(),
4855
5295
  linkedinUrl: z.string().nullable(),
@@ -4896,6 +5336,7 @@ var AcqContactCompanySummarySchema = z.object({
4896
5336
  var AcqContactResponseSchema = z.object({
4897
5337
  id: z.string(),
4898
5338
  organizationId: z.string(),
5339
+ clientId: z.string().nullable().optional(),
4899
5340
  companyId: z.string().nullable(),
4900
5341
  email: z.string(),
4901
5342
  emailValid: AcqEmailValidSchema.nullable(),
@@ -4955,6 +5396,24 @@ z.object({
4955
5396
  limit: z.coerce.number().int().min(1).max(500).default(50),
4956
5397
  offset: z.coerce.number().int().min(0).default(0)
4957
5398
  }).strict();
5399
+ var ListRecordEntitySchema = z.enum(["company", "contact"]);
5400
+ z.object({
5401
+ entity: ListRecordEntitySchema,
5402
+ stage: LeadGenStageKeySchema.optional(),
5403
+ limit: z.coerce.number().int().min(1).max(500).default(50),
5404
+ offset: z.coerce.number().int().min(0).default(0)
5405
+ }).strict().superRefine((query, ctx) => {
5406
+ if (!query.stage) return;
5407
+ const stage = LEAD_GEN_STAGE_CATALOG[query.stage];
5408
+ const validEntity = stage?.entity === query.entity || stage?.additionalEntities?.includes(query.entity) || stage?.recordEntity === query.entity;
5409
+ if (!validEntity) {
5410
+ ctx.addIssue({
5411
+ code: z.ZodIssueCode.custom,
5412
+ message: `stage "${query.stage}" is not valid for ${query.entity} records`,
5413
+ path: ["stage"]
5414
+ });
5415
+ }
5416
+ });
4958
5417
  z.object({
4959
5418
  memberId: UuidSchema
4960
5419
  });
@@ -4983,6 +5442,70 @@ var AcqListMemberResponseSchema = z.object({
4983
5442
  z.object({
4984
5443
  members: z.array(AcqListMemberResponseSchema)
4985
5444
  });
5445
+ var AcqListRecordCompanySummarySchema = z.object({
5446
+ id: z.string(),
5447
+ name: z.string(),
5448
+ domain: z.string().nullable(),
5449
+ website: z.string().nullable(),
5450
+ linkedinUrl: z.string().nullable(),
5451
+ numEmployees: z.number().nullable(),
5452
+ foundedYear: z.number().nullable(),
5453
+ locationCity: z.string().nullable(),
5454
+ locationState: z.string().nullable(),
5455
+ category: z.string().nullable(),
5456
+ segment: z.string().nullable(),
5457
+ status: AcqCompanyStatusSchema,
5458
+ qualificationScore: z.number().nullable(),
5459
+ qualificationSignals: z.record(z.string(), z.unknown()).nullable(),
5460
+ qualificationRubricKey: z.string().nullable()
5461
+ });
5462
+ var AcqListRecordContactSummarySchema = z.object({
5463
+ id: z.string(),
5464
+ email: z.string(),
5465
+ firstName: z.string().nullable(),
5466
+ lastName: z.string().nullable(),
5467
+ title: z.string().nullable(),
5468
+ headline: z.string().nullable(),
5469
+ linkedinUrl: z.string().nullable(),
5470
+ companyId: z.string().nullable(),
5471
+ status: AcqContactStatusSchema,
5472
+ qualificationScore: z.number().nullable(),
5473
+ qualificationSignals: z.record(z.string(), z.unknown()).nullable(),
5474
+ qualificationRubricKey: z.string().nullable()
5475
+ });
5476
+ var ListRecordBaseSchema = z.object({
5477
+ id: z.string(),
5478
+ listId: z.string(),
5479
+ pipelineKey: z.string(),
5480
+ stageKey: z.string(),
5481
+ stateKey: z.string(),
5482
+ activityLog: z.unknown(),
5483
+ addedAt: z.string(),
5484
+ addedBy: z.string().nullable(),
5485
+ sourceExecutionId: z.string().nullable(),
5486
+ processingState: z.record(z.string(), z.unknown()).nullable(),
5487
+ enrichmentData: z.record(z.string(), z.unknown()).nullable()
5488
+ });
5489
+ var AcqListCompanyRecordRowSchema = ListRecordBaseSchema.extend({
5490
+ entity: z.literal("company"),
5491
+ companyId: z.string(),
5492
+ company: AcqListRecordCompanySummarySchema.nullable()
5493
+ });
5494
+ var AcqListContactRecordRowSchema = ListRecordBaseSchema.extend({
5495
+ entity: z.literal("contact"),
5496
+ contactId: z.string(),
5497
+ contact: AcqListRecordContactSummarySchema.nullable()
5498
+ });
5499
+ var ListRecordRowSchema = z.discriminatedUnion("entity", [
5500
+ AcqListCompanyRecordRowSchema,
5501
+ AcqListContactRecordRowSchema
5502
+ ]);
5503
+ z.object({
5504
+ data: z.array(ListRecordRowSchema),
5505
+ total: z.number().int().min(0),
5506
+ limit: z.number().int().min(1),
5507
+ offset: z.number().int().min(0)
5508
+ });
4986
5509
  z.object({
4987
5510
  listCompanyId: UuidSchema
4988
5511
  });
@@ -5147,4 +5670,4 @@ function isOurReplyAction(deal) {
5147
5670
  var listBuilderStageKeys = Object.keys(LEAD_GEN_STAGE_CATALOG);
5148
5671
  var ListBuilderStageKeySchema = z.enum(listBuilderStageKeys);
5149
5672
 
5150
- export { ActivityEventSchema, BuildPlanSnapshotStepSchema, ProspectingBuildTemplateSchema as BuildTemplateSchema, CRM_PIPELINE_DEFINITION, CrmStageKeySchema, CrmStateKeySchema, DEFAULT_CRM_ACTIONS, EmailSchema, ExecutionError, LEAD_GEN_STAGE_CATALOG, ListBuilderStageKeySchema, ProcessingStageStatusSchema, RegistryValidationError, ResourceRegistry, StepType, ToolingError, deriveActions };
5673
+ export { ActivityEventSchema, BuildPlanSnapshotStepSchema, ProspectingBuildTemplateSchema as BuildTemplateSchema, CRM_PIPELINE_DEFINITION, CrmStageKeySchema, CrmStateKeySchema, DEFAULT_CRM_ACTIONS, EmailSchema, ExecutionError, LEAD_GEN_STAGE_CATALOG, ListBuilderStageKeySchema, ProcessingStageStatusSchema, RegistryValidationError, ResourceRegistry, StepType, ToolingError, deriveActions, validateResourceGovernance };