@elevasis/sdk 1.17.0 → 1.18.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.
@@ -9,12 +9,15 @@ interface KnowledgeCodegenNode {
9
9
  links: {
10
10
  nodeId: string;
11
11
  }[];
12
+ skills: string[];
13
+ domain?: string;
12
14
  ownerIds: string[];
13
15
  updatedAt: string;
14
16
  }
15
17
  interface GenerateKnowledgeNodesOptions {
16
18
  sourceDir: string;
17
19
  outputPath: string;
20
+ graphSkillsOutputPath?: string;
18
21
  typeImportPath?: string;
19
22
  exportedName?: string;
20
23
  sourceLabel?: string;
@@ -79,10 +79,35 @@ function readKnowledgeNodeMdx(filePath) {
79
79
  icon: optionalString(frontmatter, "icon", filePath),
80
80
  body,
81
81
  links: optionalStringArray(frontmatter, "links", filePath).map((nodeId) => ({ nodeId })),
82
+ skills: optionalStringArray(frontmatter, "skills", filePath),
83
+ domain: optionalString(frontmatter, "domain", filePath),
82
84
  ownerIds: optionalStringArray(frontmatter, "ownerIds", filePath),
83
85
  updatedAt: assertString(frontmatter, "updatedAt", filePath)
84
86
  };
85
87
  }
88
+ function generateGraphSkillsRegistry(nodes) {
89
+ const domains = {};
90
+ for (const node of nodes) {
91
+ if (!node.domain) continue;
92
+ const domain = domains[node.domain] ?? { skills: [], nodes: [] };
93
+ const skills = [...new Set(node.skills)].sort((a, b) => a.localeCompare(b));
94
+ domain.nodes.push({
95
+ id: node.id,
96
+ title: node.title,
97
+ kind: node.kind,
98
+ skills
99
+ });
100
+ domain.skills = [.../* @__PURE__ */ new Set([...domain.skills, ...skills])].sort((a, b) => a.localeCompare(b));
101
+ domains[node.domain] = domain;
102
+ }
103
+ for (const domain of Object.values(domains)) {
104
+ domain.nodes.sort((a, b) => a.id.localeCompare(b.id));
105
+ }
106
+ return {
107
+ generatedBy: "generate-knowledge-nodes",
108
+ domains: Object.fromEntries(Object.entries(domains).sort(([a], [b]) => a.localeCompare(b)))
109
+ };
110
+ }
86
111
  function generateKnowledgeNodesTs(options) {
87
112
  const exportedName = options.exportedName ?? "mdxKnowledgeNodes";
88
113
  const typeImport = options.typeImportPath ? [`import type { OrgKnowledgeNode } from '${options.typeImportPath}'`, ""] : [];
@@ -118,6 +143,15 @@ function generateKnowledgeNodes(options) {
118
143
  }),
119
144
  "utf8"
120
145
  );
146
+ if (options.graphSkillsOutputPath) {
147
+ mkdirSync(dirname(options.graphSkillsOutputPath), { recursive: true });
148
+ writeFileSync(
149
+ options.graphSkillsOutputPath,
150
+ `${JSON.stringify(generateGraphSkillsRegistry(nodes), null, 2)}
151
+ `,
152
+ "utf8"
153
+ );
154
+ }
121
155
  return { nodes, outputPath: options.outputPath };
122
156
  }
123
157
  var ALLOWED_COMPONENTS = /* @__PURE__ */ new Set(["Card", "Cards", "Step", "Steps", "Callout", "Tab", "Tabs"]);
@@ -181,7 +215,6 @@ var FACTORY_BLOCK = [
181
215
  " * to be { Fragment, jsx, jsxs } from react/jsx-runtime.",
182
216
  " */",
183
217
  "function makeKnowledgeComponent(fnBody: string): ComponentType<KnowledgeBodyProps> {",
184
- " // eslint-disable-next-line @typescript-eslint/no-implied-eval",
185
218
  " const factory = new Function(fnBody) as (runtime: MDXRuntime) => { default: ComponentType }",
186
219
  " return function KnowledgeBody(props: KnowledgeBodyProps) {",
187
220
  " const runtime = { Fragment, jsx, jsxs, ...props } as unknown as MDXRuntime",
@@ -965,7 +965,7 @@ type Database = {
965
965
  name: string;
966
966
  num_employees: number | null;
967
967
  organization_id: string;
968
- pipeline_status: Json;
968
+ processing_state: Json;
969
969
  qualification_rubric_key: string | null;
970
970
  qualification_score: number | null;
971
971
  qualification_signals: Json | null;
@@ -991,7 +991,7 @@ type Database = {
991
991
  name: string;
992
992
  num_employees?: number | null;
993
993
  organization_id: string;
994
- pipeline_status?: Json;
994
+ processing_state?: Json;
995
995
  qualification_rubric_key?: string | null;
996
996
  qualification_score?: number | null;
997
997
  qualification_signals?: Json | null;
@@ -1017,7 +1017,7 @@ type Database = {
1017
1017
  name?: string;
1018
1018
  num_employees?: number | null;
1019
1019
  organization_id?: string;
1020
- pipeline_status?: Json;
1020
+ processing_state?: Json;
1021
1021
  qualification_rubric_key?: string | null;
1022
1022
  qualification_score?: number | null;
1023
1023
  qualification_signals?: Json | null;
@@ -1056,7 +1056,7 @@ type Database = {
1056
1056
  nurture: boolean;
1057
1057
  opening_line: string | null;
1058
1058
  organization_id: string;
1059
- pipeline_status: Json;
1059
+ processing_state: Json;
1060
1060
  qualification_rubric_key: string | null;
1061
1061
  qualification_score: number | null;
1062
1062
  qualification_signals: Json | null;
@@ -1084,7 +1084,7 @@ type Database = {
1084
1084
  nurture?: boolean;
1085
1085
  opening_line?: string | null;
1086
1086
  organization_id: string;
1087
- pipeline_status?: Json;
1087
+ processing_state?: Json;
1088
1088
  qualification_rubric_key?: string | null;
1089
1089
  qualification_score?: number | null;
1090
1090
  qualification_signals?: Json | null;
@@ -1112,7 +1112,7 @@ type Database = {
1112
1112
  nurture?: boolean;
1113
1113
  opening_line?: string | null;
1114
1114
  organization_id?: string;
1115
- pipeline_status?: Json;
1115
+ processing_state?: Json;
1116
1116
  qualification_rubric_key?: string | null;
1117
1117
  qualification_score?: number | null;
1118
1118
  qualification_signals?: Json | null;
@@ -1508,7 +1508,6 @@ type Database = {
1508
1508
  id: string;
1509
1509
  list_id: string;
1510
1510
  pipeline_key: string;
1511
- processing_state: Json;
1512
1511
  source_execution_id: string | null;
1513
1512
  source_input_hash: string | null;
1514
1513
  source_resource_id: string | null;
@@ -1523,7 +1522,6 @@ type Database = {
1523
1522
  id?: string;
1524
1523
  list_id: string;
1525
1524
  pipeline_key?: string;
1526
- processing_state?: Json;
1527
1525
  source_execution_id?: string | null;
1528
1526
  source_input_hash?: string | null;
1529
1527
  source_resource_id?: string | null;
@@ -1538,7 +1536,6 @@ type Database = {
1538
1536
  id?: string;
1539
1537
  list_id?: string;
1540
1538
  pipeline_key?: string;
1541
- processing_state?: Json;
1542
1539
  source_execution_id?: string | null;
1543
1540
  source_input_hash?: string | null;
1544
1541
  source_resource_id?: string | null;
@@ -1617,7 +1614,6 @@ type Database = {
1617
1614
  id: string;
1618
1615
  list_id: string;
1619
1616
  pipeline_key: string;
1620
- processing_state: Json;
1621
1617
  source_execution_id: string | null;
1622
1618
  source_input_hash: string | null;
1623
1619
  source_resource_id: string | null;
@@ -1632,7 +1628,6 @@ type Database = {
1632
1628
  id?: string;
1633
1629
  list_id: string;
1634
1630
  pipeline_key?: string;
1635
- processing_state?: Json;
1636
1631
  source_execution_id?: string | null;
1637
1632
  source_input_hash?: string | null;
1638
1633
  source_resource_id?: string | null;
@@ -1647,7 +1642,6 @@ type Database = {
1647
1642
  id?: string;
1648
1643
  list_id?: string;
1649
1644
  pipeline_key?: string;
1650
- processing_state?: Json;
1651
1645
  source_execution_id?: string | null;
1652
1646
  source_input_hash?: string | null;
1653
1647
  source_resource_id?: string | null;
@@ -3799,6 +3793,33 @@ type Database = {
3799
3793
  };
3800
3794
  };
3801
3795
 
3796
+ /** One entry in the lead-gen stage catalog. */
3797
+ interface LeadGenStageCatalogEntry {
3798
+ /** Matches the status key written into processing_state jsonb (e.g. 'scraped'). */
3799
+ key: string;
3800
+ /** Human-readable label for UI display. */
3801
+ label: string;
3802
+ /** Short description of what this stage represents. */
3803
+ description: string;
3804
+ /** Canonical pipeline order for UI sorting. Lower = earlier in the funnel. */
3805
+ order: number;
3806
+ /** Which entity's processing_state jsonb carries this stage status. */
3807
+ entity: 'company' | 'contact';
3808
+ }
3809
+ /**
3810
+ * Canonical lead-gen processing stage catalog.
3811
+ * Keys are the stage names written by workflow steps into processing_state jsonb.
3812
+ *
3813
+ * Ordered roughly by pipeline progression (prospecting → outreach → qualification).
3814
+ */
3815
+ declare const LEAD_GEN_STAGE_CATALOG: Record<string, LeadGenStageCatalogEntry>;
3816
+
3817
+ declare const ProcessingStageStatusSchema: z.ZodEnum<{
3818
+ error: "error";
3819
+ success: "success";
3820
+ no_result: "no_result";
3821
+ skipped: "skipped";
3822
+ }>;
3802
3823
  declare const DealSchemas: {
3803
3824
  DealIdParams: z.ZodObject<{
3804
3825
  dealId: z.ZodString;
@@ -3935,7 +3956,15 @@ declare const DealSchemas: {
3935
3956
  title: z.ZodNullable<z.ZodString>;
3936
3957
  headline: z.ZodNullable<z.ZodString>;
3937
3958
  linkedin_url: z.ZodNullable<z.ZodString>;
3938
- pipeline_status: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3959
+ processing_state: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
3960
+ status: z.ZodEnum<{
3961
+ error: "error";
3962
+ success: "success";
3963
+ no_result: "no_result";
3964
+ skipped: "skipped";
3965
+ }>;
3966
+ data: z.ZodOptional<z.ZodUnknown>;
3967
+ }, z.core.$loose>>>;
3939
3968
  enrichment_data: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3940
3969
  company: z.ZodNullable<z.ZodObject<{
3941
3970
  id: z.ZodString;
@@ -4049,7 +4078,15 @@ declare const DealSchemas: {
4049
4078
  title: z.ZodNullable<z.ZodString>;
4050
4079
  headline: z.ZodNullable<z.ZodString>;
4051
4080
  linkedin_url: z.ZodNullable<z.ZodString>;
4052
- pipeline_status: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4081
+ processing_state: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
4082
+ status: z.ZodEnum<{
4083
+ error: "error";
4084
+ success: "success";
4085
+ no_result: "no_result";
4086
+ skipped: "skipped";
4087
+ }>;
4088
+ data: z.ZodOptional<z.ZodUnknown>;
4089
+ }, z.core.$loose>>>;
4053
4090
  enrichment_data: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4054
4091
  company: z.ZodNullable<z.ZodObject<{
4055
4092
  id: z.ZodString;
@@ -4147,57 +4184,21 @@ declare const PipelineStageSchema: z.ZodObject<{
4147
4184
  enabled: z.ZodOptional<z.ZodBoolean>;
4148
4185
  order: z.ZodOptional<z.ZodNumber>;
4149
4186
  }, z.core.$strip>;
4150
- /**
4151
- * Terminal row-level status for one lead-gen processing stage.
4152
- * Missing key still means not attempted; legacy boolean `true` is normalized
4153
- * to `success` by the API reader during rollout.
4154
- */
4155
- declare const ProcessingStageStatusSchema: z.ZodEnum<{
4156
- error: "error";
4157
- success: "success";
4158
- no_result: "no_result";
4159
- skipped: "skipped";
4160
- }>;
4161
4187
  type PipelineStage = z.infer<typeof PipelineStageSchema>;
4162
4188
  type ProcessingStageStatus = z.infer<typeof ProcessingStageStatusSchema>;
4163
4189
 
4164
4190
  /** Raw database row type for acq_deals table */
4165
4191
  type AcqDealRow = Database['public']['Tables']['acq_deals']['Row'];
4166
- /**
4167
- * Tracks pipeline status for a company across all processing stages.
4168
- */
4169
- interface CompanyPipelineStatus {
4170
- acquired: boolean;
4171
- enrichment: {
4172
- [source: string]: {
4173
- status: 'pending' | 'complete' | 'failed' | 'skipped';
4174
- completedAt?: string;
4175
- error?: string;
4176
- };
4177
- };
4178
- }
4179
- /**
4180
- * Tracks pipeline status for a contact across all processing stages.
4181
- */
4182
- interface ContactPipelineStatus {
4183
- enrichment: {
4184
- [source: string]: {
4185
- status: 'pending' | 'complete' | 'failed' | 'skipped';
4186
- completedAt?: string;
4187
- error?: string;
4188
- };
4189
- };
4190
- personalization: {
4191
- status: 'pending' | 'complete' | 'failed' | 'skipped';
4192
- completedAt?: string;
4193
- };
4194
- outreach: {
4195
- status: 'pending' | 'sent' | 'replied' | 'bounced' | 'opted-out';
4196
- sentAt?: string;
4197
- channel?: string;
4198
- campaignId?: string;
4199
- };
4192
+ type LeadGenStageKey = (typeof LEAD_GEN_STAGE_CATALOG)[keyof typeof LEAD_GEN_STAGE_CATALOG]['key'];
4193
+ interface ProcessingStateEntry {
4194
+ status: ProcessingStageStatus;
4195
+ data?: unknown;
4200
4196
  }
4197
+ type ProcessingState = Partial<Record<LeadGenStageKey, ProcessingStateEntry>>;
4198
+ type CompanyProcessingState = ProcessingState;
4199
+ type ContactProcessingState = ProcessingState;
4200
+ /** @deprecated Use `processingState`. Retained only as a compile-time/read-shape bridge for external tenants. */
4201
+ type LegacyPipelineStatus = unknown;
4201
4202
  /**
4202
4203
  * Enrichment data collected for a company from various sources.
4203
4204
  */
@@ -4350,7 +4351,9 @@ interface AcqCompany {
4350
4351
  category: string | null;
4351
4352
  categoryPain: string | null;
4352
4353
  segment: string | null;
4353
- pipelineStatus: CompanyPipelineStatus | null;
4354
+ processingState: CompanyProcessingState | null;
4355
+ /** @deprecated Use `processingState`. This legacy DB column has been removed; responses return null. */
4356
+ pipelineStatus?: LegacyPipelineStatus | null;
4354
4357
  enrichmentData: CompanyEnrichmentData | null;
4355
4358
  source: string | null;
4356
4359
  batchId: string | null;
@@ -4385,7 +4388,9 @@ interface AcqContact {
4385
4388
  openingLine: string | null;
4386
4389
  source: string | null;
4387
4390
  sourceId: string | null;
4388
- pipelineStatus: ContactPipelineStatus | null;
4391
+ processingState: ContactProcessingState | null;
4392
+ /** @deprecated Use `processingState`. This legacy DB column has been removed; responses return null. */
4393
+ pipelineStatus?: LegacyPipelineStatus | null;
4389
4394
  enrichmentData: ContactEnrichmentData | null;
4390
4395
  /** Attio Person record ID - set when contact responds and is added to CRM */
4391
4396
  attioPersonId: string | null;
@@ -4412,7 +4417,7 @@ interface DealContact {
4412
4417
  title: string | null;
4413
4418
  headline: string | null;
4414
4419
  linkedin_url: string | null;
4415
- pipeline_status: Record<string, unknown> | null;
4420
+ processing_state: Record<string, unknown> | null;
4416
4421
  enrichment_data: Record<string, unknown> | null;
4417
4422
  company: {
4418
4423
  id: string;
@@ -4501,6 +4506,8 @@ interface CreateCompanyParams {
4501
4506
  source?: string;
4502
4507
  batchId?: string;
4503
4508
  verticalResearch?: string;
4509
+ /** @deprecated Use processingState. Accepted as a no-op compatibility bridge for external tenants. */
4510
+ pipelineStatus?: unknown;
4504
4511
  }
4505
4512
  interface UpdateCompanyParams {
4506
4513
  name?: string;
@@ -4513,7 +4520,9 @@ interface UpdateCompanyParams {
4513
4520
  locationState?: string;
4514
4521
  category?: string;
4515
4522
  segment?: string;
4516
- pipelineStatus?: Record<string, unknown>;
4523
+ processingState?: ProcessingState;
4524
+ /** @deprecated Use processingState. Accepted as a no-op compatibility bridge for external tenants. */
4525
+ pipelineStatus?: unknown;
4517
4526
  enrichmentData?: Record<string, unknown>;
4518
4527
  source?: string;
4519
4528
  batchId?: string;
@@ -4521,7 +4530,7 @@ interface UpdateCompanyParams {
4521
4530
  verticalResearch?: string | null;
4522
4531
  /** Track A: flat qualification score column (null until a scoring rubric is defined) */
4523
4532
  qualificationScore?: number | null;
4524
- /** Track A: flat qualification signals jsonb — mirrors the former pipeline_status.qualification shape */
4533
+ /** Track A: flat qualification signals jsonb */
4525
4534
  qualificationSignals?: Record<string, unknown> | null;
4526
4535
  /** Track A: key identifying the rubric used for qualification */
4527
4536
  qualificationRubricKey?: string | null;
@@ -4534,13 +4543,15 @@ interface CompanyFilters {
4534
4543
  website?: string;
4535
4544
  segment?: string;
4536
4545
  category?: string;
4537
- pipelineStatus?: Record<string, unknown>;
4538
- /** Exclude companies whose pipeline_status contains this value (PostgREST NOT contains) */
4539
- pipelineStatusNot?: Record<string, unknown>;
4546
+ processingState?: ProcessingState;
4547
+ /** @deprecated Use processingState. Accepted as a no-op compatibility bridge for external tenants. */
4548
+ pipelineStatus?: unknown;
4549
+ /** Exclude companies whose processing state contains this value (PostgREST NOT contains) */
4550
+ processingStateNot?: ProcessingState;
4540
4551
  batchId?: string;
4541
4552
  status?: 'active' | 'invalid';
4542
4553
  includeAll?: boolean;
4543
- excludeColumns?: Array<'enrichmentData' | 'pipelineStatus'>;
4554
+ excludeColumns?: Array<'enrichmentData' | 'processingState'>;
4544
4555
  limit?: number;
4545
4556
  }
4546
4557
  interface CreateContactParams {
@@ -4554,6 +4565,8 @@ interface CreateContactParams {
4554
4565
  source?: string;
4555
4566
  sourceId?: string;
4556
4567
  batchId?: string;
4568
+ /** @deprecated Use processingState. Accepted as a no-op compatibility bridge for external tenants. */
4569
+ pipelineStatus?: unknown;
4557
4570
  }
4558
4571
  interface UpdateContactParams {
4559
4572
  companyId?: string;
@@ -4565,7 +4578,9 @@ interface UpdateContactParams {
4565
4578
  headline?: string;
4566
4579
  filterReason?: string;
4567
4580
  openingLine?: string;
4568
- pipelineStatus?: Record<string, unknown>;
4581
+ processingState?: ProcessingState;
4582
+ /** @deprecated Use processingState. Accepted as a no-op compatibility bridge for external tenants. */
4583
+ pipelineStatus?: unknown;
4569
4584
  enrichmentData?: Record<string, unknown>;
4570
4585
  status?: 'active' | 'invalid';
4571
4586
  }
@@ -4574,7 +4589,9 @@ interface ContactFilters {
4574
4589
  listId?: string;
4575
4590
  search?: string;
4576
4591
  openingLineIsNull?: boolean;
4577
- pipelineStatus?: Record<string, unknown>;
4592
+ processingState?: ProcessingState;
4593
+ /** @deprecated Use processingState. Accepted as a no-op compatibility bridge for external tenants. */
4594
+ pipelineStatus?: unknown;
4578
4595
  batchId?: string;
4579
4596
  contactStatus?: 'active' | 'invalid';
4580
4597
  }
@@ -4832,6 +4849,18 @@ interface UpdateContactStageParams {
4832
4849
  status?: ProcessingStageStatus;
4833
4850
  executionId?: string;
4834
4851
  }
4852
+ interface ListPendingCompanyIdsParams {
4853
+ organizationId: string;
4854
+ listId: string;
4855
+ stageKey: string;
4856
+ limit?: number;
4857
+ }
4858
+ interface ListPendingContactIdsParams {
4859
+ organizationId: string;
4860
+ listId: string;
4861
+ stageKey: string;
4862
+ limit?: number;
4863
+ }
4835
4864
  interface AddCompaniesToListParams {
4836
4865
  organizationId: string;
4837
4866
  listId: string;
@@ -4869,7 +4898,7 @@ interface BulkImportCompanyEntry {
4869
4898
  category?: string;
4870
4899
  source?: string;
4871
4900
  enrichmentData?: Record<string, unknown>;
4872
- pipelineStatus?: Record<string, unknown>;
4901
+ processingState?: ProcessingState;
4873
4902
  }
4874
4903
  interface BulkImportCompaniesParams {
4875
4904
  organizationId: string;
@@ -7835,6 +7864,14 @@ type ListToolMap = {
7835
7864
  params: Omit<UpdateContactStageParams, 'organizationId'>;
7836
7865
  result: void;
7837
7866
  };
7867
+ listPendingCompanyIds: {
7868
+ params: Omit<ListPendingCompanyIdsParams, 'organizationId'>;
7869
+ result: string[];
7870
+ };
7871
+ listPendingContactIds: {
7872
+ params: Omit<ListPendingContactIdsParams, 'organizationId'>;
7873
+ result: string[];
7874
+ };
7838
7875
  };
7839
7876
  type PdfToolMap = {
7840
7877
  render: {