@elevasis/sdk 1.15.1 → 1.16.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 (59) hide show
  1. package/dist/cli.cjs +2325 -124
  2. package/dist/index.d.ts +410 -473
  3. package/dist/index.js +96 -44
  4. package/dist/node/index.d.ts +69 -0
  5. package/dist/node/index.js +273 -0
  6. package/dist/test-utils/index.d.ts +473 -466
  7. package/dist/types/worker/platform.d.ts +2 -9
  8. package/package.json +12 -3
  9. package/reference/_navigation.md +23 -1
  10. package/reference/_reference-manifest.json +98 -0
  11. package/reference/claude-config/rules/agent-start-here.md +13 -0
  12. package/reference/claude-config/rules/organization-model.md +40 -40
  13. package/reference/claude-config/rules/organization-os.md +16 -16
  14. package/reference/claude-config/rules/vibe.md +13 -13
  15. package/reference/claude-config/skills/knowledge/SKILL.md +253 -0
  16. package/reference/claude-config/skills/{configure → knowledge}/operations/codify-level-a.md +100 -100
  17. package/reference/claude-config/skills/{configure → knowledge}/operations/codify-level-b.md +158 -158
  18. package/reference/claude-config/skills/knowledge/operations/customers.md +109 -0
  19. package/reference/claude-config/skills/knowledge/operations/features.md +113 -0
  20. package/reference/claude-config/skills/knowledge/operations/goals.md +118 -0
  21. package/reference/claude-config/skills/knowledge/operations/identity.md +93 -0
  22. package/reference/claude-config/skills/knowledge/operations/labels.md +89 -0
  23. package/reference/claude-config/skills/knowledge/operations/offerings.md +109 -0
  24. package/reference/claude-config/skills/knowledge/operations/roles.md +99 -0
  25. package/reference/claude-config/skills/knowledge/operations/techStack.md +102 -0
  26. package/reference/claude-config/skills/run-ui/SKILL.md +73 -0
  27. package/reference/claude-config/skills/setup/SKILL.md +270 -270
  28. package/reference/claude-config/skills/tutorial/SKILL.md +249 -0
  29. package/reference/claude-config/skills/tutorial/progress-template.md +74 -0
  30. package/reference/claude-config/skills/tutorial/technical.md +1309 -0
  31. package/reference/claude-config/skills/tutorial/vibe-coder.md +890 -0
  32. package/reference/claude-config/sync-notes/2026-05-04-elevasis-workspace.md +71 -0
  33. package/reference/claude-config/sync-notes/2026-05-04-template-skills-run-ui-and-tutorial.md +59 -0
  34. package/reference/deployment/index.mdx +5 -5
  35. package/reference/examples/organization-model.ts +40 -0
  36. package/reference/framework/index.mdx +1 -1
  37. package/reference/framework/tutorial-system.mdx +86 -173
  38. package/reference/packages/core/src/knowledge/README.md +32 -0
  39. package/reference/packages/ui/src/knowledge/README.md +31 -0
  40. package/reference/packages/ui/src/theme/presets/README.md +19 -0
  41. package/reference/scaffold/core/organization-model.mdx +1 -1
  42. package/reference/scaffold/recipes/add-a-feature.md +1 -1
  43. package/reference/scaffold/recipes/customize-crm-actions.md +433 -433
  44. package/reference/scaffold/recipes/customize-organization-model.md +3 -3
  45. package/reference/scaffold/recipes/extend-lead-gen.md +90 -55
  46. package/reference/scaffold/recipes/gate-by-feature-or-admin.md +1 -1
  47. package/reference/scaffold/recipes/index.md +6 -0
  48. package/reference/scaffold/reference/contracts.md +1265 -1154
  49. package/reference/scaffold/reference/feature-registry.md +2 -1
  50. package/reference/scaffold/ui/composition-extensibility.mdx +17 -0
  51. package/reference/claude-config/skills/configure/SKILL.md +0 -98
  52. package/reference/claude-config/skills/configure/operations/customers.md +0 -150
  53. package/reference/claude-config/skills/configure/operations/features.md +0 -162
  54. package/reference/claude-config/skills/configure/operations/goals.md +0 -147
  55. package/reference/claude-config/skills/configure/operations/identity.md +0 -133
  56. package/reference/claude-config/skills/configure/operations/labels.md +0 -128
  57. package/reference/claude-config/skills/configure/operations/offerings.md +0 -159
  58. package/reference/claude-config/skills/configure/operations/roles.md +0 -153
  59. package/reference/claude-config/skills/configure/operations/techStack.md +0 -139
package/dist/index.d.ts CHANGED
@@ -21,6 +21,16 @@ import { z } from 'zod';
21
21
  * @module validation
22
22
  */
23
23
 
24
+ /**
25
+ * Validates email format (RFC 5322)
26
+ *
27
+ * Security: Prevents email header injection, validates format before sending
28
+ *
29
+ * @example
30
+ * EmailSchema.parse('user@example.com') // OK
31
+ * EmailSchema.parse('invalid') // Error: Invalid email
32
+ */
33
+ declare const EmailSchema: z.ZodString;
24
34
  /**
25
35
  * Standard pagination parameters
26
36
  *
@@ -290,56 +300,6 @@ interface IExecutionLogger {
290
300
  error(message: string, context?: LogContext): void;
291
301
  }
292
302
 
293
- /**
294
- * Shared form field types for dynamic form generation
295
- * Used by: Command Queue, Execution Runner UI, future form-based features
296
- */
297
- /**
298
- * Supported form field types for action payloads
299
- * Maps to Mantine form components
300
- */
301
- type FormFieldType = 'text' | 'textarea' | 'number' | 'select' | 'checkbox' | 'radio' | 'richtext';
302
- /**
303
- * Form field definition
304
- */
305
- interface FormField {
306
- /** Field key in payload object */
307
- name: string;
308
- /** Field label for UI */
309
- label: string;
310
- /** Field type (determines UI component) */
311
- type: FormFieldType;
312
- /** Default value */
313
- defaultValue?: unknown;
314
- /** Required field */
315
- required?: boolean;
316
- /** Placeholder text */
317
- placeholder?: string;
318
- /** Help text */
319
- description?: string;
320
- /** Options for select/radio */
321
- options?: Array<{
322
- label: string;
323
- value: string | number;
324
- }>;
325
- /** Min/max for number */
326
- min?: number;
327
- max?: number;
328
- /** Path to context value for pre-filling (dot notation, e.g., 'proposal.summary') */
329
- defaultValueFromContext?: string;
330
- }
331
- /**
332
- * Form schema for action payload collection
333
- */
334
- interface FormSchema {
335
- /** Form title */
336
- title?: string;
337
- /** Form description */
338
- description?: string;
339
- /** Form fields */
340
- fields: FormField[];
341
- }
342
-
343
303
  /**
344
304
  * Serialized Registry Types
345
305
  *
@@ -347,67 +307,6 @@ interface FormSchema {
347
307
  * Serialization happens once at API startup, enabling instant response times.
348
308
  */
349
309
 
350
- /**
351
- * Serialized form field for API responses
352
- */
353
- interface SerializedFormField {
354
- name: string;
355
- label: string;
356
- type: FormFieldType;
357
- defaultValue?: unknown;
358
- required?: boolean;
359
- placeholder?: string;
360
- description?: string;
361
- options?: Array<{
362
- label: string;
363
- value: string | number;
364
- }>;
365
- min?: number;
366
- max?: number;
367
- }
368
- /**
369
- * Serialized form schema for API responses
370
- */
371
- interface SerializedFormSchema {
372
- title?: string;
373
- description?: string;
374
- fields: SerializedFormField[];
375
- layout?: 'vertical' | 'horizontal' | 'grid';
376
- }
377
- /**
378
- * Serialized execution form schema for API responses
379
- */
380
- interface SerializedExecutionFormSchema extends SerializedFormSchema {
381
- fieldMappings?: Record<string, string>;
382
- submitButton?: {
383
- label?: string;
384
- loadingLabel?: string;
385
- confirmMessage?: string;
386
- };
387
- }
388
- /**
389
- * Serialized schedule config for API responses
390
- */
391
- interface SerializedScheduleConfig {
392
- enabled: boolean;
393
- defaultSchedule?: string;
394
- allowedPatterns?: string[];
395
- }
396
- /**
397
- * Serialized webhook config for API responses
398
- */
399
- interface SerializedWebhookConfig {
400
- enabled: boolean;
401
- payloadSchema?: unknown;
402
- }
403
- /**
404
- * Serialized execution interface for API responses
405
- */
406
- interface SerializedExecutionInterface {
407
- form: SerializedExecutionFormSchema;
408
- schedule?: SerializedScheduleConfig;
409
- webhook?: SerializedWebhookConfig;
410
- }
411
310
  /**
412
311
  * Serialized agent definition (JSON-safe)
413
312
  * Result of serializeDefinition(AgentDefinition)
@@ -463,7 +362,6 @@ interface SerializedAgentDefinition {
463
362
  }>;
464
363
  };
465
364
  metricsConfig?: object;
466
- interface?: SerializedExecutionInterface;
467
365
  }
468
366
  /**
469
367
  * Serialized workflow definition (JSON-safe)
@@ -503,7 +401,6 @@ interface SerializedWorkflowDefinition {
503
401
  outputSchema?: object;
504
402
  };
505
403
  metricsConfig?: object;
506
- interface?: SerializedExecutionInterface;
507
404
  }
508
405
 
509
406
  /**
@@ -604,6 +501,56 @@ interface ModelConfig {
604
501
  modelOptions?: ModelSpecificOptions;
605
502
  }
606
503
 
504
+ /**
505
+ * Shared form field types for dynamic form generation
506
+ * Used by: Command Queue, Execution Runner UI, future form-based features
507
+ */
508
+ /**
509
+ * Supported form field types for action payloads
510
+ * Maps to Mantine form components
511
+ */
512
+ type FormFieldType = 'text' | 'textarea' | 'number' | 'select' | 'checkbox' | 'radio' | 'richtext';
513
+ /**
514
+ * Form field definition
515
+ */
516
+ interface FormField {
517
+ /** Field key in payload object */
518
+ name: string;
519
+ /** Field label for UI */
520
+ label: string;
521
+ /** Field type (determines UI component) */
522
+ type: FormFieldType;
523
+ /** Default value */
524
+ defaultValue?: unknown;
525
+ /** Required field */
526
+ required?: boolean;
527
+ /** Placeholder text */
528
+ placeholder?: string;
529
+ /** Help text */
530
+ description?: string;
531
+ /** Options for select/radio */
532
+ options?: Array<{
533
+ label: string;
534
+ value: string | number;
535
+ }>;
536
+ /** Min/max for number */
537
+ min?: number;
538
+ max?: number;
539
+ /** Path to context value for pre-filling (dot notation, e.g., 'proposal.summary') */
540
+ defaultValueFromContext?: string;
541
+ }
542
+ /**
543
+ * Form schema for action payload collection
544
+ */
545
+ interface FormSchema {
546
+ /** Form title */
547
+ title?: string;
548
+ /** Form description */
549
+ description?: string;
550
+ /** Form fields */
551
+ fields: FormField[];
552
+ }
553
+
607
554
  /**
608
555
  * Execution interface configuration
609
556
  * Defines how a resource is executed via the UI (forms, scheduling, webhooks)
@@ -661,6 +608,8 @@ interface WebhookConfig {
661
608
 
662
609
  interface WorkflowConfig extends ResourceDefinition {
663
610
  type: 'workflow';
611
+ /** Lead-gen capability key for registry derivation (e.g. 'lead-gen.company.apollo-import') */
612
+ capabilityKey?: string;
664
613
  }
665
614
  interface WorkflowStepDefinition {
666
615
  id: string;
@@ -4016,309 +3965,6 @@ type Database = {
4016
3965
  };
4017
3966
  };
4018
3967
 
4019
- /** Raw database row type for acq_deals table */
4020
- type AcqDealRow = Database['public']['Tables']['acq_deals']['Row'];
4021
- /**
4022
- * Tracks pipeline status for a company across all processing stages.
4023
- */
4024
- interface CompanyPipelineStatus {
4025
- acquired: boolean;
4026
- enrichment: {
4027
- [source: string]: {
4028
- status: 'pending' | 'complete' | 'failed' | 'skipped';
4029
- completedAt?: string;
4030
- error?: string;
4031
- };
4032
- };
4033
- }
4034
- /**
4035
- * Tracks pipeline status for a contact across all processing stages.
4036
- */
4037
- interface ContactPipelineStatus {
4038
- enrichment: {
4039
- [source: string]: {
4040
- status: 'pending' | 'complete' | 'failed' | 'skipped';
4041
- completedAt?: string;
4042
- error?: string;
4043
- };
4044
- };
4045
- personalization: {
4046
- status: 'pending' | 'complete' | 'failed' | 'skipped';
4047
- completedAt?: string;
4048
- };
4049
- outreach: {
4050
- status: 'pending' | 'sent' | 'replied' | 'bounced' | 'opted-out';
4051
- sentAt?: string;
4052
- channel?: string;
4053
- campaignId?: string;
4054
- };
4055
- }
4056
- /**
4057
- * Enrichment data collected for a company from various sources.
4058
- */
4059
- interface CompanyEnrichmentData {
4060
- googleMaps?: {
4061
- placeId?: string;
4062
- totalScore?: number;
4063
- reviewsCount?: number;
4064
- address?: string;
4065
- phone?: string;
4066
- categoryName?: string;
4067
- googleMapsUrl?: string;
4068
- scrapedAt?: string;
4069
- };
4070
- websiteCrawl?: {
4071
- companyDescription?: string;
4072
- services?: string[];
4073
- specialties?: string[];
4074
- staff?: Array<{
4075
- name: string;
4076
- title?: string;
4077
- email?: string;
4078
- }>;
4079
- automationGaps?: string[];
4080
- targetAudience?: string;
4081
- category?: string;
4082
- segment?: string;
4083
- recentWin?: string;
4084
- emailCount?: number;
4085
- pageCount?: number;
4086
- totalChars?: number;
4087
- crawledAt?: string;
4088
- extractedAt?: string;
4089
- };
4090
- website?: {
4091
- missionVision?: string;
4092
- uniqueAttributes?: string;
4093
- coreOfferings?: string;
4094
- targetAudience?: string;
4095
- companyValues?: string;
4096
- businessDescription?: string;
4097
- recentPosts?: Array<{
4098
- date?: string;
4099
- title?: string;
4100
- summary?: string;
4101
- aiInsight?: string;
4102
- }>;
4103
- };
4104
- tomba?: {
4105
- waterfallEmail?: {
4106
- email: string;
4107
- name?: string;
4108
- title?: string;
4109
- department?: string;
4110
- } | null;
4111
- genericEmail?: string | null;
4112
- totalFound?: number;
4113
- searchedAt?: string;
4114
- };
4115
- }
4116
- /**
4117
- * Enrichment data collected for a contact from various sources.
4118
- */
4119
- interface ContactEnrichmentData {
4120
- linkedin?: {
4121
- summary?: string;
4122
- pastExperience?: string;
4123
- education?: string;
4124
- activity?: Array<{
4125
- date?: string;
4126
- content?: string;
4127
- }>;
4128
- };
4129
- }
4130
- type ListStatus = 'draft' | 'enriching' | 'launched' | 'closing' | 'archived';
4131
- interface ScrapingConfig {
4132
- source?: string;
4133
- query?: string;
4134
- filters?: Record<string, unknown>;
4135
- [key: string]: unknown;
4136
- }
4137
- interface IcpRubric {
4138
- targetDescription?: string;
4139
- minReviewCount?: number;
4140
- minRating?: number;
4141
- excludeFranchises?: boolean;
4142
- customRules?: string;
4143
- qualificationRubricKey?: string | null;
4144
- [key: string]: unknown;
4145
- }
4146
- interface PipelineStage {
4147
- key: string;
4148
- label?: string;
4149
- description?: string;
4150
- resourceId?: string;
4151
- inputTemplate?: Record<string, unknown>;
4152
- enabled?: boolean;
4153
- order?: number;
4154
- }
4155
- interface PipelineConfig {
4156
- stages: PipelineStage[];
4157
- }
4158
- type BuildPlanSnapshotPrimaryEntity = 'company' | 'contact';
4159
- type BuildPlanSnapshotOutput = 'company' | 'contact' | 'export';
4160
- type BuildPlanSnapshotDependencyMode = 'per-record-eligibility';
4161
- interface BuildPlanSnapshotStep {
4162
- id: string;
4163
- label: string;
4164
- description?: string;
4165
- primaryEntity: BuildPlanSnapshotPrimaryEntity;
4166
- outputs: BuildPlanSnapshotOutput[];
4167
- stageKey: string;
4168
- dependsOn?: string[];
4169
- dependencyMode: BuildPlanSnapshotDependencyMode;
4170
- capabilityKey: string;
4171
- defaultBatchSize: number;
4172
- maxBatchSize: number;
4173
- }
4174
- interface BuildPlanSnapshot {
4175
- templateId: string;
4176
- templateLabel: string;
4177
- steps: BuildPlanSnapshotStep[];
4178
- }
4179
- interface AcqListMetadata extends Record<string, unknown> {
4180
- buildPlanSnapshot?: BuildPlanSnapshot;
4181
- }
4182
- interface AcqList {
4183
- id: string;
4184
- organizationId: string;
4185
- name: string;
4186
- description: string | null;
4187
- batchIds: string[];
4188
- instantlyCampaignId: string | null;
4189
- status: ListStatus;
4190
- scrapingConfig: ScrapingConfig;
4191
- icp: IcpRubric;
4192
- pipelineConfig: PipelineConfig;
4193
- metadata: AcqListMetadata;
4194
- launchedAt: Date | null;
4195
- completedAt: Date | null;
4196
- createdAt: Date;
4197
- }
4198
- /**
4199
- * Company record in the acquisition database.
4200
- * Contains enriched company data from various sources.
4201
- * Transformed from AcqCompanyRow with camelCase properties.
4202
- */
4203
- interface AcqCompany {
4204
- id: string;
4205
- organizationId: string;
4206
- name: string;
4207
- domain: string | null;
4208
- linkedinUrl: string | null;
4209
- website: string | null;
4210
- numEmployees: number | null;
4211
- foundedYear: number | null;
4212
- locationCity: string | null;
4213
- locationState: string | null;
4214
- category: string | null;
4215
- categoryPain: string | null;
4216
- segment: string | null;
4217
- pipelineStatus: CompanyPipelineStatus | null;
4218
- enrichmentData: CompanyEnrichmentData | null;
4219
- source: string | null;
4220
- batchId: string | null;
4221
- status: 'active' | 'invalid';
4222
- verticalResearch: string | null;
4223
- /** Track A: flat qualification score (null until a scoring rubric is defined). Added by W1 migration. */
4224
- qualificationScore: number | null;
4225
- /** Track A: flat qualification signals jsonb preserving the result payload shape. Added by W1 migration. */
4226
- qualificationSignals: Record<string, unknown> | null;
4227
- /** Track A: key identifying the rubric used for qualification. Added by W1 migration. */
4228
- qualificationRubricKey: string | null;
4229
- createdAt: Date;
4230
- updatedAt: Date;
4231
- }
4232
- /**
4233
- * Contact record in the acquisition database.
4234
- * Contains enriched contact data and personalization content.
4235
- * Transformed from AcqContactRow with camelCase properties.
4236
- */
4237
- interface AcqContact {
4238
- id: string;
4239
- organizationId: string;
4240
- companyId: string | null;
4241
- email: string;
4242
- emailValid: 'VALID' | 'INVALID' | 'RISKY' | 'UNKNOWN' | null;
4243
- firstName: string | null;
4244
- lastName: string | null;
4245
- linkedinUrl: string | null;
4246
- title: string | null;
4247
- headline: string | null;
4248
- filterReason: string | null;
4249
- openingLine: string | null;
4250
- source: string | null;
4251
- sourceId: string | null;
4252
- pipelineStatus: ContactPipelineStatus | null;
4253
- enrichmentData: ContactEnrichmentData | null;
4254
- /** Attio Person record ID - set when contact responds and is added to CRM */
4255
- attioPersonId: string | null;
4256
- batchId: string | null;
4257
- status: 'active' | 'invalid';
4258
- createdAt: Date;
4259
- updatedAt: Date;
4260
- }
4261
- type DealPriorityBucketKey = 'needs_response' | 'follow_up_due' | 'waiting' | 'stale' | 'closed_low';
4262
- interface DealPriority {
4263
- bucketKey: DealPriorityBucketKey;
4264
- rank: number;
4265
- label: string;
4266
- color: string;
4267
- reason: string;
4268
- latestActivityAt: string | null;
4269
- nextActionAt: string | null;
4270
- }
4271
- interface DealContact {
4272
- id: string;
4273
- first_name: string | null;
4274
- last_name: string | null;
4275
- email: string;
4276
- title: string | null;
4277
- headline: string | null;
4278
- linkedin_url: string | null;
4279
- pipeline_status: Record<string, unknown> | null;
4280
- enrichment_data: Record<string, unknown> | null;
4281
- company: {
4282
- id: string;
4283
- name: string;
4284
- domain: string | null;
4285
- website: string | null;
4286
- linkedin_url: string | null;
4287
- segment: string | null;
4288
- category: string | null;
4289
- num_employees: number | null;
4290
- } | null;
4291
- }
4292
- /** Deal list item with joined contact and company data */
4293
- interface DealListItem extends AcqDealRow {
4294
- priority: DealPriority;
4295
- ownership: 'us' | 'them' | null;
4296
- nextAction: string | null;
4297
- contact: DealContact | null;
4298
- }
4299
- type DealDetail = DealListItem;
4300
- /** Task kind options for a deal task (human follow-up action type) */
4301
- type AcqDealTaskKind = 'call' | 'email' | 'meeting' | 'other';
4302
- /**
4303
- * A CRM to-do item attached to a deal representing a human follow-up action.
4304
- * Transformed from AcqDealTaskRow with camelCase properties.
4305
- */
4306
- interface AcqDealTask {
4307
- id: string;
4308
- organizationId: string;
4309
- dealId: string;
4310
- title: string;
4311
- description: string | null;
4312
- kind: AcqDealTaskKind;
4313
- dueAt: string | null;
4314
- assigneeUserId: string | null;
4315
- completedAt: string | null;
4316
- completedByUserId: string | null;
4317
- createdAt: string;
4318
- updatedAt: string;
4319
- createdByUserId: string | null;
4320
- }
4321
-
4322
3968
  declare const DealSchemas: {
4323
3969
  DealIdParams: z.ZodObject<{
4324
3970
  dealId: z.ZodString;
@@ -4627,47 +4273,353 @@ declare const DealSchemas: {
4627
4273
  call: "call";
4628
4274
  meeting: "meeting";
4629
4275
  }>;
4630
- dueAt: z.ZodNullable<z.ZodString>;
4631
- assigneeUserId: z.ZodNullable<z.ZodString>;
4632
- completedAt: z.ZodNullable<z.ZodString>;
4633
- completedByUserId: z.ZodNullable<z.ZodString>;
4634
- createdAt: z.ZodString;
4635
- updatedAt: z.ZodString;
4636
- createdByUserId: z.ZodNullable<z.ZodString>;
4637
- }, z.core.$strip>;
4638
- DealTaskListResponse: z.ZodArray<z.ZodObject<{
4639
- id: z.ZodString;
4640
- organizationId: z.ZodString;
4641
- dealId: z.ZodString;
4642
- title: z.ZodString;
4643
- description: z.ZodNullable<z.ZodString>;
4644
- kind: z.ZodEnum<{
4645
- other: "other";
4646
- email: "email";
4647
- call: "call";
4648
- meeting: "meeting";
4276
+ dueAt: z.ZodNullable<z.ZodString>;
4277
+ assigneeUserId: z.ZodNullable<z.ZodString>;
4278
+ completedAt: z.ZodNullable<z.ZodString>;
4279
+ completedByUserId: z.ZodNullable<z.ZodString>;
4280
+ createdAt: z.ZodString;
4281
+ updatedAt: z.ZodString;
4282
+ createdByUserId: z.ZodNullable<z.ZodString>;
4283
+ }, z.core.$strip>;
4284
+ DealTaskListResponse: z.ZodArray<z.ZodObject<{
4285
+ id: z.ZodString;
4286
+ organizationId: z.ZodString;
4287
+ dealId: z.ZodString;
4288
+ title: z.ZodString;
4289
+ description: z.ZodNullable<z.ZodString>;
4290
+ kind: z.ZodEnum<{
4291
+ other: "other";
4292
+ email: "email";
4293
+ call: "call";
4294
+ meeting: "meeting";
4295
+ }>;
4296
+ dueAt: z.ZodNullable<z.ZodString>;
4297
+ assigneeUserId: z.ZodNullable<z.ZodString>;
4298
+ completedAt: z.ZodNullable<z.ZodString>;
4299
+ completedByUserId: z.ZodNullable<z.ZodString>;
4300
+ createdAt: z.ZodString;
4301
+ updatedAt: z.ZodString;
4302
+ createdByUserId: z.ZodNullable<z.ZodString>;
4303
+ }, z.core.$strip>>;
4304
+ };
4305
+ /**
4306
+ * One stage entry in a list's `pipeline_config.stages[]`. The `key` is
4307
+ * validated against `LEAD_GEN_STAGE_CATALOG` so list pipeline definitions
4308
+ * stay aligned with the org-os semantic layer.
4309
+ */
4310
+ declare const PipelineStageSchema: z.ZodObject<{
4311
+ key: z.ZodString;
4312
+ label: z.ZodOptional<z.ZodString>;
4313
+ enabled: z.ZodOptional<z.ZodBoolean>;
4314
+ order: z.ZodOptional<z.ZodNumber>;
4315
+ }, z.core.$strip>;
4316
+ /**
4317
+ * Terminal row-level status for one lead-gen processing stage.
4318
+ * Missing key still means not attempted; legacy boolean `true` is normalized
4319
+ * to `success` by the API reader during rollout.
4320
+ */
4321
+ declare const ProcessingStageStatusSchema: z.ZodEnum<{
4322
+ error: "error";
4323
+ success: "success";
4324
+ no_result: "no_result";
4325
+ skipped: "skipped";
4326
+ }>;
4327
+ type PipelineStage = z.infer<typeof PipelineStageSchema>;
4328
+ type ProcessingStageStatus = z.infer<typeof ProcessingStageStatusSchema>;
4329
+
4330
+ /** Raw database row type for acq_deals table */
4331
+ type AcqDealRow = Database['public']['Tables']['acq_deals']['Row'];
4332
+ /**
4333
+ * Tracks pipeline status for a company across all processing stages.
4334
+ */
4335
+ interface CompanyPipelineStatus {
4336
+ acquired: boolean;
4337
+ enrichment: {
4338
+ [source: string]: {
4339
+ status: 'pending' | 'complete' | 'failed' | 'skipped';
4340
+ completedAt?: string;
4341
+ error?: string;
4342
+ };
4343
+ };
4344
+ }
4345
+ /**
4346
+ * Tracks pipeline status for a contact across all processing stages.
4347
+ */
4348
+ interface ContactPipelineStatus {
4349
+ enrichment: {
4350
+ [source: string]: {
4351
+ status: 'pending' | 'complete' | 'failed' | 'skipped';
4352
+ completedAt?: string;
4353
+ error?: string;
4354
+ };
4355
+ };
4356
+ personalization: {
4357
+ status: 'pending' | 'complete' | 'failed' | 'skipped';
4358
+ completedAt?: string;
4359
+ };
4360
+ outreach: {
4361
+ status: 'pending' | 'sent' | 'replied' | 'bounced' | 'opted-out';
4362
+ sentAt?: string;
4363
+ channel?: string;
4364
+ campaignId?: string;
4365
+ };
4366
+ }
4367
+ /**
4368
+ * Enrichment data collected for a company from various sources.
4369
+ */
4370
+ interface CompanyEnrichmentData {
4371
+ googleMaps?: {
4372
+ placeId?: string;
4373
+ totalScore?: number;
4374
+ reviewsCount?: number;
4375
+ address?: string;
4376
+ phone?: string;
4377
+ categoryName?: string;
4378
+ googleMapsUrl?: string;
4379
+ scrapedAt?: string;
4380
+ };
4381
+ websiteCrawl?: {
4382
+ companyDescription?: string;
4383
+ services?: string[];
4384
+ specialties?: string[];
4385
+ staff?: Array<{
4386
+ name: string;
4387
+ title?: string;
4388
+ email?: string;
4389
+ }>;
4390
+ automationGaps?: string[];
4391
+ targetAudience?: string;
4392
+ category?: string;
4393
+ segment?: string;
4394
+ recentWin?: string;
4395
+ emailCount?: number;
4396
+ pageCount?: number;
4397
+ totalChars?: number;
4398
+ crawledAt?: string;
4399
+ extractedAt?: string;
4400
+ };
4401
+ website?: {
4402
+ missionVision?: string;
4403
+ uniqueAttributes?: string;
4404
+ coreOfferings?: string;
4405
+ targetAudience?: string;
4406
+ companyValues?: string;
4407
+ businessDescription?: string;
4408
+ recentPosts?: Array<{
4409
+ date?: string;
4410
+ title?: string;
4411
+ summary?: string;
4412
+ aiInsight?: string;
4413
+ }>;
4414
+ };
4415
+ tomba?: {
4416
+ waterfallEmail?: {
4417
+ email: string;
4418
+ name?: string;
4419
+ title?: string;
4420
+ department?: string;
4421
+ } | null;
4422
+ genericEmail?: string | null;
4423
+ totalFound?: number;
4424
+ searchedAt?: string;
4425
+ };
4426
+ }
4427
+ /**
4428
+ * Enrichment data collected for a contact from various sources.
4429
+ */
4430
+ interface ContactEnrichmentData {
4431
+ linkedin?: {
4432
+ summary?: string;
4433
+ pastExperience?: string;
4434
+ education?: string;
4435
+ activity?: Array<{
4436
+ date?: string;
4437
+ content?: string;
4649
4438
  }>;
4650
- dueAt: z.ZodNullable<z.ZodString>;
4651
- assigneeUserId: z.ZodNullable<z.ZodString>;
4652
- completedAt: z.ZodNullable<z.ZodString>;
4653
- completedByUserId: z.ZodNullable<z.ZodString>;
4654
- createdAt: z.ZodString;
4655
- updatedAt: z.ZodString;
4656
- createdByUserId: z.ZodNullable<z.ZodString>;
4657
- }, z.core.$strip>>;
4658
- };
4439
+ };
4440
+ }
4441
+ type ListStatus = 'draft' | 'enriching' | 'launched' | 'closing' | 'archived';
4442
+ interface ScrapingConfig {
4443
+ source?: string;
4444
+ query?: string;
4445
+ filters?: Record<string, unknown>;
4446
+ [key: string]: unknown;
4447
+ }
4448
+ interface IcpRubric {
4449
+ targetDescription?: string;
4450
+ minReviewCount?: number;
4451
+ minRating?: number;
4452
+ excludeFranchises?: boolean;
4453
+ customRules?: string;
4454
+ qualificationRubricKey?: string | null;
4455
+ [key: string]: unknown;
4456
+ }
4457
+ interface PipelineConfig {
4458
+ stages: PipelineStage[];
4459
+ }
4460
+ type BuildPlanSnapshotPrimaryEntity = 'company' | 'contact';
4461
+ type BuildPlanSnapshotOutput = 'company' | 'contact' | 'export';
4462
+ type BuildPlanSnapshotDependencyMode = 'per-record-eligibility';
4463
+ interface BuildPlanSnapshotStep {
4464
+ id: string;
4465
+ label: string;
4466
+ description?: string;
4467
+ primaryEntity: BuildPlanSnapshotPrimaryEntity;
4468
+ outputs: BuildPlanSnapshotOutput[];
4469
+ stageKey: string;
4470
+ dependsOn?: string[];
4471
+ dependencyMode: BuildPlanSnapshotDependencyMode;
4472
+ capabilityKey: string;
4473
+ defaultBatchSize: number;
4474
+ maxBatchSize: number;
4475
+ }
4476
+ interface BuildPlanSnapshot {
4477
+ templateId: string;
4478
+ templateLabel: string;
4479
+ steps: BuildPlanSnapshotStep[];
4480
+ }
4481
+ interface AcqListMetadata extends Record<string, unknown> {
4482
+ buildPlanSnapshot?: BuildPlanSnapshot;
4483
+ }
4484
+ interface AcqList {
4485
+ id: string;
4486
+ organizationId: string;
4487
+ name: string;
4488
+ description: string | null;
4489
+ batchIds: string[];
4490
+ instantlyCampaignId: string | null;
4491
+ status: ListStatus;
4492
+ scrapingConfig: ScrapingConfig;
4493
+ icp: IcpRubric;
4494
+ pipelineConfig: PipelineConfig;
4495
+ metadata: AcqListMetadata;
4496
+ launchedAt: Date | null;
4497
+ completedAt: Date | null;
4498
+ createdAt: Date;
4499
+ }
4659
4500
  /**
4660
- * Terminal row-level status for one lead-gen processing stage.
4661
- * Missing key still means not attempted; legacy boolean `true` is normalized
4662
- * to `success` by the API reader during rollout.
4501
+ * Company record in the acquisition database.
4502
+ * Contains enriched company data from various sources.
4503
+ * Transformed from AcqCompanyRow with camelCase properties.
4663
4504
  */
4664
- declare const ProcessingStageStatusSchema: z.ZodEnum<{
4665
- error: "error";
4666
- success: "success";
4667
- skipped: "skipped";
4668
- no_result: "no_result";
4669
- }>;
4670
- type ProcessingStageStatus = z.infer<typeof ProcessingStageStatusSchema>;
4505
+ interface AcqCompany {
4506
+ id: string;
4507
+ organizationId: string;
4508
+ name: string;
4509
+ domain: string | null;
4510
+ linkedinUrl: string | null;
4511
+ website: string | null;
4512
+ numEmployees: number | null;
4513
+ foundedYear: number | null;
4514
+ locationCity: string | null;
4515
+ locationState: string | null;
4516
+ category: string | null;
4517
+ categoryPain: string | null;
4518
+ segment: string | null;
4519
+ pipelineStatus: CompanyPipelineStatus | null;
4520
+ enrichmentData: CompanyEnrichmentData | null;
4521
+ source: string | null;
4522
+ batchId: string | null;
4523
+ status: 'active' | 'invalid';
4524
+ verticalResearch: string | null;
4525
+ /** Track A: flat qualification score (null until a scoring rubric is defined). Added by W1 migration. */
4526
+ qualificationScore: number | null;
4527
+ /** Track A: flat qualification signals jsonb preserving the result payload shape. Added by W1 migration. */
4528
+ qualificationSignals: Record<string, unknown> | null;
4529
+ /** Track A: key identifying the rubric used for qualification. Added by W1 migration. */
4530
+ qualificationRubricKey: string | null;
4531
+ createdAt: Date;
4532
+ updatedAt: Date;
4533
+ }
4534
+ /**
4535
+ * Contact record in the acquisition database.
4536
+ * Contains enriched contact data and personalization content.
4537
+ * Transformed from AcqContactRow with camelCase properties.
4538
+ */
4539
+ interface AcqContact {
4540
+ id: string;
4541
+ organizationId: string;
4542
+ companyId: string | null;
4543
+ email: string;
4544
+ emailValid: 'VALID' | 'INVALID' | 'RISKY' | 'UNKNOWN' | null;
4545
+ firstName: string | null;
4546
+ lastName: string | null;
4547
+ linkedinUrl: string | null;
4548
+ title: string | null;
4549
+ headline: string | null;
4550
+ filterReason: string | null;
4551
+ openingLine: string | null;
4552
+ source: string | null;
4553
+ sourceId: string | null;
4554
+ pipelineStatus: ContactPipelineStatus | null;
4555
+ enrichmentData: ContactEnrichmentData | null;
4556
+ /** Attio Person record ID - set when contact responds and is added to CRM */
4557
+ attioPersonId: string | null;
4558
+ batchId: string | null;
4559
+ status: 'active' | 'invalid';
4560
+ createdAt: Date;
4561
+ updatedAt: Date;
4562
+ }
4563
+ type DealPriorityBucketKey = 'needs_response' | 'follow_up_due' | 'waiting' | 'stale' | 'closed_low';
4564
+ interface DealPriority {
4565
+ bucketKey: DealPriorityBucketKey;
4566
+ rank: number;
4567
+ label: string;
4568
+ color: string;
4569
+ reason: string;
4570
+ latestActivityAt: string | null;
4571
+ nextActionAt: string | null;
4572
+ }
4573
+ interface DealContact {
4574
+ id: string;
4575
+ first_name: string | null;
4576
+ last_name: string | null;
4577
+ email: string;
4578
+ title: string | null;
4579
+ headline: string | null;
4580
+ linkedin_url: string | null;
4581
+ pipeline_status: Record<string, unknown> | null;
4582
+ enrichment_data: Record<string, unknown> | null;
4583
+ company: {
4584
+ id: string;
4585
+ name: string;
4586
+ domain: string | null;
4587
+ website: string | null;
4588
+ linkedin_url: string | null;
4589
+ segment: string | null;
4590
+ category: string | null;
4591
+ num_employees: number | null;
4592
+ } | null;
4593
+ }
4594
+ /** Deal list item with joined contact and company data */
4595
+ interface DealListItem extends AcqDealRow {
4596
+ priority: DealPriority;
4597
+ ownership: 'us' | 'them' | null;
4598
+ nextAction: string | null;
4599
+ contact: DealContact | null;
4600
+ }
4601
+ type DealDetail = DealListItem;
4602
+ /** Task kind options for a deal task (human follow-up action type) */
4603
+ type AcqDealTaskKind = 'call' | 'email' | 'meeting' | 'other';
4604
+ /**
4605
+ * A CRM to-do item attached to a deal representing a human follow-up action.
4606
+ * Transformed from AcqDealTaskRow with camelCase properties.
4607
+ */
4608
+ interface AcqDealTask {
4609
+ id: string;
4610
+ organizationId: string;
4611
+ dealId: string;
4612
+ title: string;
4613
+ description: string | null;
4614
+ kind: AcqDealTaskKind;
4615
+ dueAt: string | null;
4616
+ assigneeUserId: string | null;
4617
+ completedAt: string | null;
4618
+ completedByUserId: string | null;
4619
+ createdAt: string;
4620
+ updatedAt: string;
4621
+ createdByUserId: string | null;
4622
+ }
4671
4623
 
4672
4624
  /**
4673
4625
  * Lead Service Types
@@ -4755,6 +4707,7 @@ interface CompanyFilters {
4755
4707
  status?: 'active' | 'invalid';
4756
4708
  includeAll?: boolean;
4757
4709
  excludeColumns?: Array<'enrichmentData' | 'pipelineStatus'>;
4710
+ limit?: number;
4758
4711
  }
4759
4712
  interface CreateContactParams {
4760
4713
  organizationId: string;
@@ -8509,7 +8462,7 @@ interface Tool {
8509
8462
  * Tooling error types
8510
8463
  * Used across platform tools and integration tools
8511
8464
  */
8512
- type ToolingErrorType = 'service_unavailable' | 'permission_denied' | 'adapter_not_found' | 'method_not_found' | 'tool_not_found' | 'credentials_missing' | 'credentials_invalid' | 'rate_limit_exceeded' | 'server_unavailable' | 'auth_error' | 'api_error' | 'validation_error' | 'network_error' | 'timeout_error' | 'unknown_error';
8465
+ type ToolingErrorType = 'service_unavailable' | 'permission_denied' | 'platform_internal' | 'adapter_not_found' | 'method_not_found' | 'tool_not_found' | 'credentials_missing' | 'credentials_invalid' | 'rate_limit_exceeded' | 'server_unavailable' | 'auth_error' | 'api_error' | 'validation_error' | 'network_error' | 'timeout_error' | 'unknown_error';
8513
8466
 
8514
8467
  /**
8515
8468
  * Supported integration types
@@ -8897,6 +8850,7 @@ declare const LinkSchema: z.ZodObject<{
8897
8850
  maps_to: "maps_to";
8898
8851
  "operates-on": "operates-on";
8899
8852
  uses: "uses";
8853
+ governs: "governs";
8900
8854
  }>;
8901
8855
  }, z.core.$strip>;
8902
8856
  type Link = z.infer<typeof LinkSchema>;
@@ -9255,23 +9209,6 @@ declare class ResourceRegistry {
9255
9209
  * @returns Command View data with nodes and edges
9256
9210
  */
9257
9211
  getCommandViewData(organizationName: string): CommandViewData;
9258
- /**
9259
- * List resources that have UI interfaces configured
9260
- * Used by Execution Runner Catalog UI
9261
- *
9262
- * @param organizationName - Organization name
9263
- * @param environment - Optional environment filter ('dev' or 'prod')
9264
- * @returns Array of resources with interfaces
9265
- */
9266
- listExecutable(organizationName: string, environment?: 'dev' | 'prod'): Array<{
9267
- resourceId: string;
9268
- resourceName: string;
9269
- resourceType: 'workflow' | 'agent';
9270
- description?: string;
9271
- status: 'dev' | 'prod';
9272
- version: string;
9273
- interface: SerializedExecutionInterface;
9274
- }>;
9275
9212
  }
9276
9213
 
9277
9214
  /**
@@ -9352,5 +9289,5 @@ declare class ToolingError extends ExecutionError {
9352
9289
  constructor(errorType: string, message: string, details?: unknown);
9353
9290
  }
9354
9291
 
9355
- export { ActivityEventSchema, DEFAULT_CRM_ACTIONS, ExecutionError, RegistryValidationError, ResourceRegistry, StepType, ToolingError, deriveActions };
9292
+ export { ActivityEventSchema, DEFAULT_CRM_ACTIONS, EmailSchema, ExecutionError, RegistryValidationError, ResourceRegistry, StepType, ToolingError, deriveActions };
9356
9293
  export type { AbsoluteScheduleConfig, AcqCompany, AcqContact, AcqDeal, AcqDealRow, AcqList, Action, ActionDef, ActivityEvent, AddToCampaignLead, AddToCampaignParams, AddToCampaignResult, AgentConfig, AgentConstraints, AgentDefinition, AgentMemory, FindCompanyEmailParams as AnymailfinderFindCompanyEmailParams, FindCompanyEmailResult as AnymailfinderFindCompanyEmailResult, FindDecisionMakerEmailParams as AnymailfinderFindDecisionMakerEmailParams, FindDecisionMakerEmailResult as AnymailfinderFindDecisionMakerEmailResult, FindPersonEmailParams as AnymailfinderFindPersonEmailParams, FindPersonEmailResult as AnymailfinderFindPersonEmailResult, AnymailfinderToolMap, VerifyEmailParams as AnymailfinderVerifyEmailParams, VerifyEmailResult as AnymailfinderVerifyEmailResult, ApifyToolMap, ApifyWebhookConfig, AppendRowsParams, AppendRowsResult, ApprovalToolMap, AttioToolMap, BatchUpdateParams, BatchUpdateResult, BulkDeleteLeadsParams, BulkDeleteLeadsResult, BulkImportParams, BulkImportResult, CancelHitlByDealIdParams, CancelSchedulesAndHitlByEmailParams, ClearDealFieldsParams, ClearRangeParams, ClearRangeResult, CompanyFilters, ConditionalNext, ContactFilters, Contract, CreateAttributeParams, CreateAttributeResult, CreateAutoPaymentLinkParams, CreateAutoPaymentLinkResult, CreateCheckoutSessionParams, CreateCheckoutSessionResult, CreateCompanyParams, CreateContactParams, CreateEnvelopeParams, CreateEnvelopeResult, CreateFolderParams, CreateFolderResult, CreateListParams, CreateNoteParams, CreateNoteResult, CreatePaymentLinkParams, CreatePaymentLinkResult, CreateRecordParams, CreateRecordResult, CreateScheduleInput, CrmToolMap, DeleteDealParams, DeleteNoteParams, DeleteNoteResult, DeleteRecordParams, DeleteRecordResult, DeleteRowByValueParams, DeleteRowByValueResult, DeploymentSpec, DownloadDocumentParams, DownloadDocumentResult, DropboxToolMap, ElevasConfig, EmailToolMap, EnvelopeDocument, EventTriggerConfig, ExecutionContext, ExecutionInterface, ExecutionMetadata, ExecutionToolMap, FilterExpression, FilterRowsParams, FilterRowsResult, FormField, FormFieldType, FormSchema, GetDailyCampaignAnalyticsParams, GetDailyCampaignAnalyticsResult, GetEmailsParams, GetEmailsResult, GetEnvelopeParams, GetEnvelopeResult, GetHeadersParams, GetHeadersResult, GetLastRowParams, GetLastRowResult, GetPaymentLinkParams, GetPaymentLinkResult, GetRecordParams, GetRecordResult, GetRowByValueParams, GetRowByValueResult, GetSpreadsheetMetadataParams, GetSpreadsheetMetadataResult, GmailSendEmailParams, GmailSendEmailResult, GmailToolMap, GoogleSheetsToolMap, HumanCheckpointDefinition, InstantlyToolMap, IntegrationDefinition, LLMAdapterFactory, LLMGenerateRequest, LLMGenerateResponse, LLMMessage, LLMModel, LeadToolMap, LinearNext, ListAttributesParams, ListAttributesResult, ListLeadsParams, ListLeadsResult, ListNotesParams, ListNotesResult, ListObjectsResult, ListPaymentLinksParams, ListPaymentLinksResult, ListToolMap, MarkProposalReviewedParams, MarkProposalSentParams, MethodEntry, MillionVerifierToolMap, ModelConfig, NextConfig, NotificationSDKInput, NotificationToolMap, PaginatedResult, PaginationParams, PdfToolMap, ProjectsToolMap, QueryRecordsParams, QueryRecordsResult, ReadSheetParams, ReadSheetResult, Recipient, RecurringScheduleConfig, RelationshipDeclaration, RelativeScheduleConfig, RemoveFromSubsequenceParams, RemoveFromSubsequenceResult, ResendGetEmailParams, ResendGetEmailResult, ResendSendEmailParams, ResendSendEmailResult, ResendToolMap, ResourceCategory, ResourceDefinition, ResourceLink, ResourceMetricsConfig, ResourceRelationships, ResourceStatus$1 as ResourceStatus, ResourceType, RunActorParams, RunActorResult, SDKLLMGenerateParams, ScheduleOriginTracking, ScheduleTarget, ScheduleTriggerConfig, SchedulerToolMap, SendReplyParams, SendReplyResult, SetContactNurtureParams, SheetInfo, SignatureApiFieldType, SignatureApiToolMap, SigningPlace, SortCriteria, StartActorParams, StartActorResult, StepHandler, StorageDeleteInput, StorageDeleteOutput, StorageDownloadInput, StorageDownloadOutput, StorageListInput, StorageListOutput, StorageSignedUrlInput, StorageSignedUrlOutput, StorageToolMap, StorageUploadInput, StorageUploadOutput, StripeToolMap, TaskSchedule, TaskScheduleConfig, TombaToolMap, Tool, ToolExecutionOptions, ToolMethodMap, ToolingErrorType, TransitionItemParams, TriggerConfig, TriggerDefinition, UpdateAttributeParams, UpdateAttributeResult, UpdateCloseLostReasonParams, UpdateCompanyParams, UpdateContactParams, UpdateDiscoveryDataParams, UpdateFeesParams, UpdateInterestStatusParams, UpdateInterestStatusResult, UpdateListParams, UpdatePaymentLinkParams, UpdatePaymentLinkResult, UpdateProposalDataParams, UpdateRecordParams, UpdateRecordResult, UpdateRowByValueParams, UpdateRowByValueResult, UploadFileParams, UploadFileResult, UpsertCompanyParams, UpsertContactParams, UpsertDealParams, UpsertRowParams, UpsertRowResult, VoidEnvelopeParams, VoidEnvelopeResult, WebhookProviderType, WebhookTriggerConfig, WorkflowConfig, WorkflowDefinition, WorkflowStep, WriteSheetParams, WriteSheetResult };