@linkt/sdk 0.2.0 → 0.4.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 (76) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/client.d.mts +7 -4
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +7 -4
  5. package/client.d.ts.map +1 -1
  6. package/client.js +3 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +3 -0
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/entity.d.mts +392 -0
  12. package/resources/entity.d.mts.map +1 -0
  13. package/resources/entity.d.ts +392 -0
  14. package/resources/entity.d.ts.map +1 -0
  15. package/resources/entity.js +164 -0
  16. package/resources/entity.js.map +1 -0
  17. package/resources/entity.mjs +160 -0
  18. package/resources/entity.mjs.map +1 -0
  19. package/resources/icp.d.mts +56 -3
  20. package/resources/icp.d.mts.map +1 -1
  21. package/resources/icp.d.ts +56 -3
  22. package/resources/icp.d.ts.map +1 -1
  23. package/resources/icp.js +2 -2
  24. package/resources/icp.mjs +2 -2
  25. package/resources/index.d.mts +3 -2
  26. package/resources/index.d.mts.map +1 -1
  27. package/resources/index.d.ts +3 -2
  28. package/resources/index.d.ts.map +1 -1
  29. package/resources/index.js +3 -1
  30. package/resources/index.js.map +1 -1
  31. package/resources/index.mjs +1 -0
  32. package/resources/index.mjs.map +1 -1
  33. package/resources/run.d.mts +3 -3
  34. package/resources/run.d.ts +3 -3
  35. package/resources/sheet/index.d.mts +1 -2
  36. package/resources/sheet/index.d.mts.map +1 -1
  37. package/resources/sheet/index.d.ts +1 -2
  38. package/resources/sheet/index.d.ts.map +1 -1
  39. package/resources/sheet/index.js +1 -3
  40. package/resources/sheet/index.js.map +1 -1
  41. package/resources/sheet/index.mjs +0 -1
  42. package/resources/sheet/index.mjs.map +1 -1
  43. package/resources/sheet/sheet.d.mts +1 -90
  44. package/resources/sheet/sheet.d.mts.map +1 -1
  45. package/resources/sheet/sheet.d.ts +1 -90
  46. package/resources/sheet/sheet.d.ts.map +1 -1
  47. package/resources/sheet/sheet.js +0 -22
  48. package/resources/sheet/sheet.js.map +1 -1
  49. package/resources/sheet/sheet.mjs +0 -22
  50. package/resources/sheet/sheet.mjs.map +1 -1
  51. package/resources/task.d.mts +443 -288
  52. package/resources/task.d.mts.map +1 -1
  53. package/resources/task.d.ts +443 -288
  54. package/resources/task.d.ts.map +1 -1
  55. package/src/client.ts +57 -20
  56. package/src/resources/entity.ts +491 -0
  57. package/src/resources/icp.ts +59 -3
  58. package/src/resources/index.ts +27 -10
  59. package/src/resources/run.ts +3 -3
  60. package/src/resources/sheet/index.ts +0 -11
  61. package/src/resources/sheet/sheet.ts +0 -136
  62. package/src/resources/task.ts +530 -329
  63. package/src/version.ts +1 -1
  64. package/version.d.mts +1 -1
  65. package/version.d.ts +1 -1
  66. package/version.js +1 -1
  67. package/version.mjs +1 -1
  68. package/resources/sheet/entity.d.mts +0 -52
  69. package/resources/sheet/entity.d.mts.map +0 -1
  70. package/resources/sheet/entity.d.ts +0 -52
  71. package/resources/sheet/entity.d.ts.map +0 -1
  72. package/resources/sheet/entity.js +0 -45
  73. package/resources/sheet/entity.js.map +0 -1
  74. package/resources/sheet/entity.mjs +0 -41
  75. package/resources/sheet/entity.mjs.map +0 -1
  76. package/src/resources/sheet/entity.ts +0 -97
@@ -121,15 +121,43 @@ export class Task extends APIResource {
121
121
  }
122
122
 
123
123
  /**
124
- * Configuration for one-time CSV enrichment tasks.
124
+ * Ingest prompt configuration in API responses.
125
125
  *
126
- * Used by ingest_csv workflows to enrich entities from uploaded CSV files. The
127
- * csv_entity_type tracks the entity type of rows IN THE CSV, which may differ from
128
- * the ICP hierarchy (e.g., CSV has people, but ICP has company→person).
126
+ * Response model for prompt-based ingest task configs that excludes
127
+ * backend-managed fields from the API surface. This is for simple prompt-based
128
+ * ingest workflows, distinct from IngestTaskConfigResponse which is for CSV
129
+ * enrichment tasks.
129
130
  *
130
- * Attributes: file_id: Reference to uploaded CSV file in S3 (via File document)
131
- * primary_column: Column containing entity names for matching csv_entity_type:
132
- * Entity type of rows in CSV (may differ from ICP hierarchy)
131
+ * Attributes: type: Config type discriminator (always "ingest-prompt"). prompt:
132
+ * Task prompt template. webhook_url: Webhook URL for completion notification.
133
+ */
134
+ export interface IngestPromptConfigResponse {
135
+ /**
136
+ * Task prompt template
137
+ */
138
+ prompt: string;
139
+
140
+ type?: 'ingest-prompt';
141
+
142
+ /**
143
+ * Webhook URL for completion notification
144
+ */
145
+ webhook_url?: string | null;
146
+ }
147
+
148
+ /**
149
+ * CSV enrichment task configuration.
150
+ *
151
+ * Enriches entities from an uploaded CSV file with additional data discovered by
152
+ * AI agents.
153
+ *
154
+ * Attributes: type: Config type discriminator (always "ingest"). file_id: ID of
155
+ * the uploaded CSV file to process. primary_column: Column containing entity names
156
+ * for matching. csv_entity_type: Entity type in the CSV (e.g., 'person',
157
+ * 'company'). webhook_url: Optional webhook URL for completion notification.
158
+ *
159
+ * Example: >>> config = IngestTaskConfigRequest( ... file_id="abc123", ...
160
+ * primary_column="company_name", ... csv_entity_type="company" ... )
133
161
  */
134
162
  export interface IngestTaskConfig {
135
163
  /**
@@ -138,84 +166,174 @@ export interface IngestTaskConfig {
138
166
  csv_entity_type: string;
139
167
 
140
168
  /**
141
- * File ID referencing uploaded CSV in MongoDB
169
+ * ID of the uploaded CSV file to process
142
170
  */
143
171
  file_id: string;
144
172
 
145
173
  /**
146
- * Column containing entity names
174
+ * Column containing entity names for matching
147
175
  */
148
176
  primary_column: string;
149
177
 
150
178
  /**
151
- * Config type for ingest tasks
179
+ * Config type discriminator
152
180
  */
153
- config_type?: 'ingest-task';
154
-
155
- version?: 'v1.0';
181
+ type?: 'ingest';
156
182
 
157
183
  /**
158
- * Optional webhook URL to notify when workflow run completes
184
+ * Optional webhook URL to notify when workflow completes
159
185
  */
160
186
  webhook_url?: string | null;
161
187
  }
162
188
 
163
189
  /**
164
- * Search v2 dual-agent configuration.
190
+ * Ingest task configuration in API responses.
191
+ *
192
+ * Response model for CSV enrichment task configs that excludes backend-managed
193
+ * fields from the API surface.
194
+ *
195
+ * Attributes: type: Config type discriminator (always "ingest"). file_id: ID of
196
+ * the CSV file. primary_column: Column containing entity names. csv_entity_type:
197
+ * Entity type in CSV. webhook_url: Webhook URL for completion notification.
165
198
  */
166
- export interface SearchV2Config {
199
+ export interface IngestTaskConfigResponse {
167
200
  /**
168
- * Jinja2 analyst agent instructions
201
+ * Entity type in CSV
169
202
  */
170
- analyst_prompt: string;
203
+ csv_entity_type: string;
171
204
 
172
205
  /**
173
- * Jinja2 discovery agent instructions
206
+ * ID of the CSV file
174
207
  */
175
- discovery_prompt: string;
208
+ file_id: string;
176
209
 
177
210
  /**
178
- * Config type (search-prompt for legacy, search-task for normalized)
211
+ * Column containing entity names
179
212
  */
180
- config_type?: 'search-prompt' | 'search-task';
213
+ primary_column: string;
181
214
 
182
- version?: 'v2.0';
215
+ type?: 'ingest';
183
216
 
184
217
  /**
185
- * Optional webhook URL to notify when workflow run completes
218
+ * Webhook URL for completion notification
186
219
  */
187
220
  webhook_url?: string | null;
188
221
  }
189
222
 
190
223
  /**
191
- * Search v3.0 configuration with planning-driven approach.
224
+ * Profile prompt task configuration.
225
+ *
226
+ * Configures a profile workflow with a custom prompt template.
192
227
  *
193
- * Key differences from v2.0:
228
+ * Attributes: type: Config type discriminator (always "profile"). prompt: Jinja2
229
+ * template for task instructions. webhook_url: Optional webhook URL for completion
230
+ * notification.
194
231
  *
195
- * - No hardcoded discovery_prompt or analyst_prompt
196
- * - desired_contact_count extracted from ICP builder session
197
- * - user_feedback field for append-only feedback accumulation
232
+ * Example: >>> config = ProfilePromptConfigRequest( ... prompt="Analyze
233
+ * {{ company_name }} and extract key metrics." ... )
198
234
  */
199
- export interface SearchV3Config {
235
+ export interface ProfilePromptConfig {
200
236
  /**
201
- * Normalized config type for all search tasks
237
+ * Jinja2 template for task instructions
202
238
  */
203
- config_type?: 'search-task';
239
+ prompt: string;
204
240
 
205
241
  /**
206
- * Number of contacts to find per company (from ICP builder session)
242
+ * Config type discriminator
243
+ */
244
+ type?: 'profile';
245
+
246
+ /**
247
+ * Optional webhook URL to notify when workflow completes
248
+ */
249
+ webhook_url?: string | null;
250
+ }
251
+
252
+ /**
253
+ * Profile prompt configuration in API responses.
254
+ *
255
+ * Response model for profile prompt task configs that excludes backend-managed
256
+ * fields from the API surface.
257
+ *
258
+ * Attributes: type: Config type discriminator (always "profile"). prompt: Task
259
+ * prompt template. webhook_url: Webhook URL for completion notification.
260
+ */
261
+ export interface ProfilePromptConfigResponse {
262
+ /**
263
+ * Task prompt template
264
+ */
265
+ prompt: string;
266
+
267
+ type?: 'profile';
268
+
269
+ /**
270
+ * Webhook URL for completion notification
271
+ */
272
+ webhook_url?: string | null;
273
+ }
274
+
275
+ /**
276
+ * Search task configuration for finding companies and contacts.
277
+ *
278
+ * Creates a v3.0 search workflow that uses AI agents to discover entities matching
279
+ * your ICP criteria.
280
+ *
281
+ * Attributes: type: Config type discriminator (always "search").
282
+ * desired_contact_count: Number of contacts to find per company (minimum: 1).
283
+ * user_feedback: Optional feedback to refine search behavior. webhook_url:
284
+ * Optional webhook URL for completion notification.
285
+ *
286
+ * Example: >>> config = SearchTaskConfigRequest(desired_contact_count=5) >>>
287
+ * mongo_config = config.to_mongo_config() >>> mongo_config.version 'v3.0'
288
+ */
289
+ export interface SearchTaskConfig {
290
+ /**
291
+ * Number of contacts to find per company (minimum: 1)
207
292
  */
208
293
  desired_contact_count?: number;
209
294
 
210
295
  /**
211
- * Accumulated user feedback (append-only)
296
+ * Config type discriminator
297
+ */
298
+ type?: 'search';
299
+
300
+ /**
301
+ * Optional feedback to refine search behavior
212
302
  */
213
303
  user_feedback?: string;
214
304
 
215
- version?: 'v3.0';
305
+ /**
306
+ * Optional webhook URL to notify when workflow completes
307
+ */
308
+ webhook_url?: string | null;
309
+ }
310
+
311
+ /**
312
+ * Search task configuration in API responses.
313
+ *
314
+ * Response model for search task configs that excludes backend-managed fields
315
+ * (version, config_type) from the API surface.
316
+ *
317
+ * Attributes: type: Config type discriminator (always "search").
318
+ * desired_contact_count: Number of contacts to find per company. user_feedback:
319
+ * Feedback to refine search behavior. webhook_url: Webhook URL for completion
320
+ * notification.
321
+ */
322
+ export interface SearchTaskConfigResponse {
323
+ /**
324
+ * Number of contacts to find per company
325
+ */
326
+ desired_contact_count: number;
327
+
328
+ /**
329
+ * Feedback to refine search behavior
330
+ */
331
+ user_feedback: string;
332
+
333
+ type?: 'search';
216
334
 
217
335
  /**
218
- * Optional webhook URL to notify when workflow run completes
336
+ * Webhook URL for completion notification
219
337
  */
220
338
  webhook_url?: string | null;
221
339
  }
@@ -223,55 +341,96 @@ export interface SearchV3Config {
223
341
  /**
224
342
  * CSV-based signal monitoring configuration.
225
343
  *
226
- * Monitors signals for companies/people uploaded via CSV file.
344
+ * Monitors signals for entities uploaded via CSV file.
227
345
  *
228
- * Attributes: version: Config version (always "v2.0") config_type: Config type
229
- * discriminator (always "signal-csv") entity_type: Type of entity being monitored
230
- * (company, person, etc.) file_id: ID of the uploaded CSV file primary_column:
231
- * Column containing entity names (defaults to "name") signal_types: Types of
232
- * signals to monitor for these entities monitoring_frequency: How often to check
233
- * for signals (daily/weekly/monthly) webhook_url: Optional webhook URL to notify
234
- * when signal run completes
346
+ * Attributes: type: Config type discriminator (always "signal-csv"). file_id: ID
347
+ * of the uploaded CSV file. signal_types: Types of signals to monitor.
348
+ * entity_type: Type of entity being monitored (default: company). primary_column:
349
+ * Column containing entity names (default: "name"). monitoring_frequency: How
350
+ * often to check (daily/weekly/monthly). webhook_url: Optional webhook URL for
351
+ * completion notification.
352
+ *
353
+ * Example: >>> config = SignalCSVConfigRequest( ... file_id="abc123", ...
354
+ * signal_types=[SignalTypeConfig(type="hiring_surge", ...)] ... )
235
355
  */
236
- export interface SignalCsvConfigInput {
356
+ export interface SignalCsvConfig {
237
357
  /**
238
358
  * ID of the uploaded CSV file
239
359
  */
240
360
  file_id: string;
241
361
 
242
362
  /**
243
- * Types of signals to monitor for these entities
363
+ * Types of signals to monitor
244
364
  */
245
365
  signal_types: Array<SignalTypeConfig>;
246
366
 
367
+ /**
368
+ * Type of entity being monitored
369
+ */
370
+ entity_type?: SheetAPI.EntityType;
371
+
372
+ /**
373
+ * How often to check for new signals
374
+ */
375
+ monitoring_frequency?: 'daily' | 'weekly' | 'monthly';
376
+
377
+ /**
378
+ * Column containing entity names
379
+ */
380
+ primary_column?: string;
381
+
247
382
  /**
248
383
  * Config type discriminator
249
384
  */
250
- config_type?: 'signal-csv';
385
+ type?: 'signal-csv';
251
386
 
252
387
  /**
253
- * Type of entity being monitored (company, school district, person, etc.)
388
+ * Optional webhook URL to notify when workflow completes
254
389
  */
255
- entity_type?: SheetAPI.EntityType;
390
+ webhook_url?: string | null;
391
+ }
256
392
 
393
+ /**
394
+ * Signal CSV configuration in API responses.
395
+ *
396
+ * Response model for CSV-based signal monitoring configs.
397
+ *
398
+ * Attributes: type: Config type discriminator (always "signal-csv"). file_id: CSV
399
+ * file ID. signal_types: Types of signals to monitor. entity_type: Type of entity
400
+ * being monitored. primary_column: Primary column for entity names.
401
+ * monitoring_frequency: How often to check for signals. webhook_url: Webhook URL
402
+ * for completion notification.
403
+ */
404
+ export interface SignalCsvConfigResponse {
257
405
  /**
258
- * How often to check for new signals (daily, weekly, monthly)
406
+ * Entity type
259
407
  */
260
- monitoring_frequency?: 'daily' | 'weekly' | 'monthly';
408
+ entity_type: SheetAPI.EntityType;
261
409
 
262
410
  /**
263
- * Column containing entity names. Defaults to 'name'. Used to extract entity names
264
- * from CSV rows during signal workflow.
411
+ * CSV file ID
265
412
  */
266
- primary_column?: string;
413
+ file_id: string;
267
414
 
268
415
  /**
269
- * Config version
416
+ * Monitoring frequency
270
417
  */
271
- version?: 'v2.0';
418
+ monitoring_frequency: 'daily' | 'weekly' | 'monthly';
419
+
420
+ /**
421
+ * Primary column
422
+ */
423
+ primary_column: string;
272
424
 
273
425
  /**
274
- * Optional webhook URL to notify when signal run completes
426
+ * Signal types
427
+ */
428
+ signal_types: Array<SignalTypeConfig>;
429
+
430
+ type?: 'signal-csv';
431
+
432
+ /**
433
+ * Webhook URL for completion notification
275
434
  */
276
435
  webhook_url?: string | null;
277
436
  }
@@ -279,21 +438,19 @@ export interface SignalCsvConfigInput {
279
438
  /**
280
439
  * Sheet-based signal monitoring configuration.
281
440
  *
282
- * Monitors signals for entities from an existing discovery ICP's sheet. Unlike CSV
283
- * mode, signals are deterministically linked to source entities without requiring
284
- * analyst agent processing.
441
+ * Monitors signals for entities from an existing discovery ICP's sheet.
285
442
  *
286
- * UPDATED 2025-12-29: Removed source_sheet_id field. Sheets are uniquely
287
- * identified by (source_icp_id, entity_type), so source_sheet_id was redundant and
288
- * never used at runtime.
443
+ * Attributes: type: Config type discriminator (always "signal-sheet").
444
+ * source_icp_id: ID of the discovery ICP containing entities to monitor.
445
+ * signal_types: Types of signals to monitor. entity_type: Type of entity being
446
+ * monitored (default: company). entity_filters: Optional MongoDB query to filter
447
+ * entities. monitoring_frequency: How often to check (daily/weekly/monthly).
448
+ * webhook_url: Optional webhook URL for completion notification.
289
449
  *
290
- * Attributes: source_icp_id: ID of the discovery ICP containing entities to
291
- * monitor entity_type: Type of entity being monitored (selects which sheet)
292
- * entity_filters: Optional MongoDB query to filter entities signal_types: Types of
293
- * signals to monitor monitoring_frequency: How often to check for signals
294
- * webhook_url: Optional webhook URL to notify when signal run completes
450
+ * Example: >>> config = SignalSheetConfigRequest( ... source_icp_id="icp123", ...
451
+ * signal_types=[SignalTypeConfig(type="leadership_change", ...)] ... )
295
452
  */
296
- export interface SignalSheetConfigInput {
453
+ export interface SignalSheetConfig {
297
454
  /**
298
455
  * Types of signals to monitor
299
456
  */
@@ -305,17 +462,12 @@ export interface SignalSheetConfigInput {
305
462
  source_icp_id: string;
306
463
 
307
464
  /**
308
- * Config type discriminator
309
- */
310
- config_type?: 'signal-sheet';
311
-
312
- /**
313
- * Optional MongoDB query to filter entities within the sheet
465
+ * Optional MongoDB query to filter entities
314
466
  */
315
467
  entity_filters?: { [key: string]: unknown } | null;
316
468
 
317
469
  /**
318
- * Type of entity being monitored (company, person, school_district, etc.)
470
+ * Type of entity being monitored
319
471
  */
320
472
  entity_type?: SheetAPI.EntityType;
321
473
 
@@ -325,12 +477,58 @@ export interface SignalSheetConfigInput {
325
477
  monitoring_frequency?: 'daily' | 'weekly' | 'monthly';
326
478
 
327
479
  /**
328
- * Config version
480
+ * Config type discriminator
329
481
  */
330
- version?: 'v2.0';
482
+ type?: 'signal-sheet';
331
483
 
332
484
  /**
333
- * Optional webhook URL to notify when signal run completes
485
+ * Optional webhook URL to notify when workflow completes
486
+ */
487
+ webhook_url?: string | null;
488
+ }
489
+
490
+ /**
491
+ * Signal sheet configuration in API responses.
492
+ *
493
+ * Response model for sheet-based signal monitoring configs.
494
+ *
495
+ * Attributes: type: Config type discriminator (always "signal-sheet").
496
+ * source_icp_id: Source ICP ID containing entities to monitor. signal_types: Types
497
+ * of signals to monitor. entity_type: Type of entity being monitored.
498
+ * entity_filters: Optional MongoDB query to filter entities. monitoring_frequency:
499
+ * How often to check for signals. webhook_url: Webhook URL for completion
500
+ * notification.
501
+ */
502
+ export interface SignalSheetConfigResponse {
503
+ /**
504
+ * Entity type
505
+ */
506
+ entity_type: SheetAPI.EntityType;
507
+
508
+ /**
509
+ * Monitoring frequency
510
+ */
511
+ monitoring_frequency: 'daily' | 'weekly' | 'monthly';
512
+
513
+ /**
514
+ * Signal types
515
+ */
516
+ signal_types: Array<SignalTypeConfig>;
517
+
518
+ /**
519
+ * Source ICP ID
520
+ */
521
+ source_icp_id: string;
522
+
523
+ /**
524
+ * Entity filters
525
+ */
526
+ entity_filters?: { [key: string]: unknown } | null;
527
+
528
+ type?: 'signal-sheet';
529
+
530
+ /**
531
+ * Webhook URL for completion notification
334
532
  */
335
533
  webhook_url?: string | null;
336
534
  }
@@ -338,20 +536,25 @@ export interface SignalSheetConfigInput {
338
536
  /**
339
537
  * Topic-based signal monitoring configuration.
340
538
  *
341
- * Monitors signals based on criteria without requiring pre-existing entities.
539
+ * Monitors for signals based on topic criteria without requiring pre-existing
540
+ * entities.
541
+ *
542
+ * Attributes: type: Config type discriminator (always "signal-topic").
543
+ * topic_criteria: Natural language description of what to monitor. signal_types:
544
+ * Types of signals to monitor. entity_type: Type of entity being monitored
545
+ * (default: company). monitoring_frequency: How often to check
546
+ * (daily/weekly/monthly). geographic_filters: Optional geographic regions to focus
547
+ * on. industry_filters: Optional industries to focus on. company_size_filters:
548
+ * Optional company size criteria. webhook_url: Optional webhook URL for completion
549
+ * notification.
342
550
  *
343
- * Attributes: version: Config version (always "v2.0") config_type: Config type
344
- * discriminator (always "signal-topic") entity_type: Type of entity being
345
- * monitored (company, person, etc.) topic_criteria: Natural language description
346
- * of what to monitor signal_types: Types of signals to monitor for this topic
347
- * monitoring_frequency: How often to check for signals (daily/weekly/monthly)
348
- * geographic_filters: Optional geographic regions to focus on industry_filters:
349
- * Optional industries to focus on company_size_filters: Optional company size
350
- * criteria webhook_url: Optional webhook URL to notify when signal run completes
551
+ * Example: >>> config = SignalTopicConfigRequest( ... topic_criteria="AI startups
552
+ * raising Series A", ... signal_types=[SignalTypeConfig(type="funding", ...)] ...
553
+ * )
351
554
  */
352
- export interface SignalTopicConfigInput {
555
+ export interface SignalTopicConfig {
353
556
  /**
354
- * Types of signals to monitor for this topic
557
+ * Types of signals to monitor
355
558
  */
356
559
  signal_types: Array<SignalTypeConfig>;
357
560
 
@@ -361,17 +564,12 @@ export interface SignalTopicConfigInput {
361
564
  topic_criteria: string;
362
565
 
363
566
  /**
364
- * Company size criteria (e.g., employee count ranges)
567
+ * Company size criteria
365
568
  */
366
569
  company_size_filters?: Array<string> | null;
367
570
 
368
571
  /**
369
- * Config type discriminator
370
- */
371
- config_type?: 'signal-topic';
372
-
373
- /**
374
- * Type of entity being monitored (company, school district, person, etc.)
572
+ * Type of entity being monitored
375
573
  */
376
574
  entity_type?: SheetAPI.EntityType;
377
575
 
@@ -386,17 +584,73 @@ export interface SignalTopicConfigInput {
386
584
  industry_filters?: Array<string> | null;
387
585
 
388
586
  /**
389
- * How often to check for new signals (daily, weekly, monthly)
587
+ * How often to check for new signals
390
588
  */
391
589
  monitoring_frequency?: 'daily' | 'weekly' | 'monthly';
392
590
 
393
591
  /**
394
- * Config version
592
+ * Config type discriminator
395
593
  */
396
- version?: 'v2.0';
594
+ type?: 'signal-topic';
397
595
 
398
596
  /**
399
- * Optional webhook URL to notify when signal run completes
597
+ * Optional webhook URL to notify when workflow completes
598
+ */
599
+ webhook_url?: string | null;
600
+ }
601
+
602
+ /**
603
+ * Signal topic configuration in API responses.
604
+ *
605
+ * Response model for topic-based signal monitoring configs.
606
+ *
607
+ * Attributes: type: Config type discriminator (always "signal-topic").
608
+ * topic_criteria: Topic criteria for monitoring. signal_types: Types of signals to
609
+ * monitor. entity_type: Type of entity being monitored. monitoring_frequency: How
610
+ * often to check for signals. geographic_filters: Geographic regions to focus on.
611
+ * industry_filters: Industries to focus on. company_size_filters: Company size
612
+ * criteria. webhook_url: Webhook URL for completion notification.
613
+ */
614
+ export interface SignalTopicConfigResponse {
615
+ /**
616
+ * Entity type
617
+ */
618
+ entity_type: SheetAPI.EntityType;
619
+
620
+ /**
621
+ * Monitoring frequency
622
+ */
623
+ monitoring_frequency: 'daily' | 'weekly' | 'monthly';
624
+
625
+ /**
626
+ * Signal types
627
+ */
628
+ signal_types: Array<SignalTypeConfig>;
629
+
630
+ /**
631
+ * Topic criteria
632
+ */
633
+ topic_criteria: string;
634
+
635
+ /**
636
+ * Size filters
637
+ */
638
+ company_size_filters?: Array<string> | null;
639
+
640
+ /**
641
+ * Geographic filters
642
+ */
643
+ geographic_filters?: Array<string> | null;
644
+
645
+ /**
646
+ * Industry filters
647
+ */
648
+ industry_filters?: Array<string> | null;
649
+
650
+ type?: 'signal-topic';
651
+
652
+ /**
653
+ * Webhook URL for completion notification
400
654
  */
401
655
  webhook_url?: string | null;
402
656
  }
@@ -441,37 +695,154 @@ export interface SignalTypeConfig {
441
695
  }
442
696
 
443
697
  /**
444
- * Standard single-prompt configuration for most flows. Used by: ingest, profile,
445
- * signal, and future single-prompt flows.
698
+ * Response model for task data.
446
699
  *
447
- * NOTE: config_type should match flow_name (e.g., 'profile-prompt',
448
- * 'ingest-prompt'). This is enforced by Task model validator.
700
+ * Uses TaskConfigResponse discriminated union for proper OpenAPI schema generation
701
+ * with type-based discrimination.
702
+ *
703
+ * Attributes: id: Task ID. name: Task name. description: Task description. icp_id:
704
+ * Task ICP ID. flow_name: Prefect flow name. deployment_name: Prefect deployment
705
+ * name. prompt: Template prompt for the task. task_config: Flow-specific task
706
+ * configuration. created_at: Creation timestamp. updated_at: Last update
707
+ * timestamp.
449
708
  */
450
- export interface StandardPromptConfig {
709
+ export interface TaskCreateResponse {
451
710
  /**
452
- * Config type (e.g., 'profile-prompt', 'ingest-prompt')
711
+ * Task ID
453
712
  */
454
- config_type: string;
713
+ id: string;
455
714
 
456
715
  /**
457
- * Jinja2 template for task instructions
716
+ * Creation timestamp
458
717
  */
459
- prompt: string;
718
+ created_at: string;
719
+
720
+ /**
721
+ * Prefect deployment name
722
+ */
723
+ deployment_name: string;
460
724
 
461
- version?: 'v1.0';
725
+ /**
726
+ * Task description
727
+ */
728
+ description: string;
462
729
 
463
730
  /**
464
- * Optional webhook URL to notify when workflow run completes
731
+ * Prefect flow name
465
732
  */
466
- webhook_url?: string | null;
733
+ flow_name: string;
734
+
735
+ /**
736
+ * Task name
737
+ */
738
+ name: string;
739
+
740
+ /**
741
+ * Last update timestamp
742
+ */
743
+ updated_at: string;
744
+
745
+ /**
746
+ * Task ICP ID
747
+ */
748
+ icp_id?: string | null;
749
+
750
+ /**
751
+ * Template prompt for the task. Can include placeholders for runtime parameters.
752
+ */
753
+ prompt?: string | null;
754
+
755
+ /**
756
+ * Flow-specific task configuration
757
+ */
758
+ task_config?:
759
+ | SearchTaskConfigResponse
760
+ | IngestTaskConfigResponse
761
+ | IngestPromptConfigResponse
762
+ | ProfilePromptConfigResponse
763
+ | SignalTopicConfigResponse
764
+ | SignalCsvConfigResponse
765
+ | SignalSheetConfigResponse
766
+ | null;
467
767
  }
468
768
 
469
- export type TaskCreateResponse = { [key: string]: unknown };
769
+ /**
770
+ * Response model for task data.
771
+ *
772
+ * Uses TaskConfigResponse discriminated union for proper OpenAPI schema generation
773
+ * with type-based discrimination.
774
+ *
775
+ * Attributes: id: Task ID. name: Task name. description: Task description. icp_id:
776
+ * Task ICP ID. flow_name: Prefect flow name. deployment_name: Prefect deployment
777
+ * name. prompt: Template prompt for the task. task_config: Flow-specific task
778
+ * configuration. created_at: Creation timestamp. updated_at: Last update
779
+ * timestamp.
780
+ */
781
+ export interface TaskRetrieveResponse {
782
+ /**
783
+ * Task ID
784
+ */
785
+ id: string;
786
+
787
+ /**
788
+ * Creation timestamp
789
+ */
790
+ created_at: string;
791
+
792
+ /**
793
+ * Prefect deployment name
794
+ */
795
+ deployment_name: string;
796
+
797
+ /**
798
+ * Task description
799
+ */
800
+ description: string;
801
+
802
+ /**
803
+ * Prefect flow name
804
+ */
805
+ flow_name: string;
806
+
807
+ /**
808
+ * Task name
809
+ */
810
+ name: string;
470
811
 
471
- export type TaskRetrieveResponse = { [key: string]: unknown };
812
+ /**
813
+ * Last update timestamp
814
+ */
815
+ updated_at: string;
816
+
817
+ /**
818
+ * Task ICP ID
819
+ */
820
+ icp_id?: string | null;
821
+
822
+ /**
823
+ * Template prompt for the task. Can include placeholders for runtime parameters.
824
+ */
825
+ prompt?: string | null;
826
+
827
+ /**
828
+ * Flow-specific task configuration
829
+ */
830
+ task_config?:
831
+ | SearchTaskConfigResponse
832
+ | IngestTaskConfigResponse
833
+ | IngestPromptConfigResponse
834
+ | ProfilePromptConfigResponse
835
+ | SignalTopicConfigResponse
836
+ | SignalCsvConfigResponse
837
+ | SignalSheetConfigResponse
838
+ | null;
839
+ }
472
840
 
473
841
  /**
474
842
  * Response model for paginated task list.
843
+ *
844
+ * Attributes: tasks: List of tasks. total: Total number of tasks matching filters.
845
+ * page: Current page number (1-based). page_size: Number of items per page.
475
846
  */
476
847
  export interface TaskListResponse {
477
848
  /**
@@ -498,6 +869,15 @@ export interface TaskListResponse {
498
869
  export namespace TaskListResponse {
499
870
  /**
500
871
  * Response model for task data.
872
+ *
873
+ * Uses TaskConfigResponse discriminated union for proper OpenAPI schema generation
874
+ * with type-based discrimination.
875
+ *
876
+ * Attributes: id: Task ID. name: Task name. description: Task description. icp_id:
877
+ * Task ICP ID. flow_name: Prefect flow name. deployment_name: Prefect deployment
878
+ * name. prompt: Template prompt for the task. task_config: Flow-specific task
879
+ * configuration. created_at: Creation timestamp. updated_at: Last update
880
+ * timestamp.
501
881
  */
502
882
  export interface Task {
503
883
  /**
@@ -546,206 +926,25 @@ export namespace TaskListResponse {
546
926
  prompt?: string | null;
547
927
 
548
928
  /**
549
- * Flow-specific task configuration with versioning
929
+ * Flow-specific task configuration
550
930
  */
551
931
  task_config?:
552
- | { [key: string]: unknown }
553
- | TaskAPI.StandardPromptConfig
554
- | TaskAPI.SearchV2Config
555
- | TaskAPI.SearchV3Config
556
- | TaskAPI.IngestTaskConfig
557
- | Task.SignalTopicConfigOutput
558
- | Task.SignalCsvConfigOutput
559
- | Task.SignalSheetConfigOutput
932
+ | TaskAPI.SearchTaskConfigResponse
933
+ | TaskAPI.IngestTaskConfigResponse
934
+ | TaskAPI.IngestPromptConfigResponse
935
+ | TaskAPI.ProfilePromptConfigResponse
936
+ | TaskAPI.SignalTopicConfigResponse
937
+ | TaskAPI.SignalCsvConfigResponse
938
+ | TaskAPI.SignalSheetConfigResponse
560
939
  | null;
561
940
  }
562
-
563
- export namespace Task {
564
- /**
565
- * Topic-based signal monitoring configuration.
566
- *
567
- * Monitors signals based on criteria without requiring pre-existing entities.
568
- *
569
- * Attributes: version: Config version (always "v2.0") config_type: Config type
570
- * discriminator (always "signal-topic") entity_type: Type of entity being
571
- * monitored (company, person, etc.) topic_criteria: Natural language description
572
- * of what to monitor signal_types: Types of signals to monitor for this topic
573
- * monitoring_frequency: How often to check for signals (daily/weekly/monthly)
574
- * geographic_filters: Optional geographic regions to focus on industry_filters:
575
- * Optional industries to focus on company_size_filters: Optional company size
576
- * criteria webhook_url: Optional webhook URL to notify when signal run completes
577
- */
578
- export interface SignalTopicConfigOutput {
579
- /**
580
- * Types of signals to monitor for this topic
581
- */
582
- signal_types: Array<TaskAPI.SignalTypeConfig>;
583
-
584
- /**
585
- * Natural language description of what to monitor
586
- */
587
- topic_criteria: string;
588
-
589
- /**
590
- * Company size criteria (e.g., employee count ranges)
591
- */
592
- company_size_filters?: Array<string> | null;
593
-
594
- /**
595
- * Config type discriminator
596
- */
597
- config_type?: 'signal-topic';
598
-
599
- /**
600
- * Type of entity being monitored (company, school district, person, etc.)
601
- */
602
- entity_type?: SheetAPI.EntityType;
603
-
604
- /**
605
- * Geographic regions to focus on
606
- */
607
- geographic_filters?: Array<string> | null;
608
-
609
- /**
610
- * Industries to focus on
611
- */
612
- industry_filters?: Array<string> | null;
613
-
614
- /**
615
- * How often to check for new signals (daily, weekly, monthly)
616
- */
617
- monitoring_frequency?: 'daily' | 'weekly' | 'monthly';
618
-
619
- /**
620
- * Config version
621
- */
622
- version?: 'v2.0';
623
-
624
- /**
625
- * Optional webhook URL to notify when signal run completes
626
- */
627
- webhook_url?: string | null;
628
- }
629
-
630
- /**
631
- * CSV-based signal monitoring configuration.
632
- *
633
- * Monitors signals for companies/people uploaded via CSV file.
634
- *
635
- * Attributes: version: Config version (always "v2.0") config_type: Config type
636
- * discriminator (always "signal-csv") entity_type: Type of entity being monitored
637
- * (company, person, etc.) file_id: ID of the uploaded CSV file primary_column:
638
- * Column containing entity names (defaults to "name") signal_types: Types of
639
- * signals to monitor for these entities monitoring_frequency: How often to check
640
- * for signals (daily/weekly/monthly) webhook_url: Optional webhook URL to notify
641
- * when signal run completes
642
- */
643
- export interface SignalCsvConfigOutput {
644
- /**
645
- * ID of the uploaded CSV file
646
- */
647
- file_id: string;
648
-
649
- /**
650
- * Types of signals to monitor for these entities
651
- */
652
- signal_types: Array<TaskAPI.SignalTypeConfig>;
653
-
654
- /**
655
- * Config type discriminator
656
- */
657
- config_type?: 'signal-csv';
658
-
659
- /**
660
- * Type of entity being monitored (company, school district, person, etc.)
661
- */
662
- entity_type?: SheetAPI.EntityType;
663
-
664
- /**
665
- * How often to check for new signals (daily, weekly, monthly)
666
- */
667
- monitoring_frequency?: 'daily' | 'weekly' | 'monthly';
668
-
669
- /**
670
- * Column containing entity names. Defaults to 'name'. Used to extract entity names
671
- * from CSV rows during signal workflow.
672
- */
673
- primary_column?: string;
674
-
675
- /**
676
- * Config version
677
- */
678
- version?: 'v2.0';
679
-
680
- /**
681
- * Optional webhook URL to notify when signal run completes
682
- */
683
- webhook_url?: string | null;
684
- }
685
-
686
- /**
687
- * Sheet-based signal monitoring configuration.
688
- *
689
- * Monitors signals for entities from an existing discovery ICP's sheet. Unlike CSV
690
- * mode, signals are deterministically linked to source entities without requiring
691
- * analyst agent processing.
692
- *
693
- * UPDATED 2025-12-29: Removed source_sheet_id field. Sheets are uniquely
694
- * identified by (source_icp_id, entity_type), so source_sheet_id was redundant and
695
- * never used at runtime.
696
- *
697
- * Attributes: source_icp_id: ID of the discovery ICP containing entities to
698
- * monitor entity_type: Type of entity being monitored (selects which sheet)
699
- * entity_filters: Optional MongoDB query to filter entities signal_types: Types of
700
- * signals to monitor monitoring_frequency: How often to check for signals
701
- * webhook_url: Optional webhook URL to notify when signal run completes
702
- */
703
- export interface SignalSheetConfigOutput {
704
- /**
705
- * Types of signals to monitor
706
- */
707
- signal_types: Array<TaskAPI.SignalTypeConfig>;
708
-
709
- /**
710
- * ID of the discovery ICP containing entities to monitor
711
- */
712
- source_icp_id: string;
713
-
714
- /**
715
- * Config type discriminator
716
- */
717
- config_type?: 'signal-sheet';
718
-
719
- /**
720
- * Optional MongoDB query to filter entities within the sheet
721
- */
722
- entity_filters?: { [key: string]: unknown } | null;
723
-
724
- /**
725
- * Type of entity being monitored (company, person, school_district, etc.)
726
- */
727
- entity_type?: SheetAPI.EntityType;
728
-
729
- /**
730
- * How often to check for new signals
731
- */
732
- monitoring_frequency?: 'daily' | 'weekly' | 'monthly';
733
-
734
- /**
735
- * Config version
736
- */
737
- version?: 'v2.0';
738
-
739
- /**
740
- * Optional webhook URL to notify when signal run completes
741
- */
742
- webhook_url?: string | null;
743
- }
744
- }
745
941
  }
746
942
 
747
943
  /**
748
944
  * Response model for task execution.
945
+ *
946
+ * Attributes: run_id: The ID of the created run. flow_run_id: The Prefect flow run
947
+ * ID. status: Initial status of the run.
749
948
  */
750
949
  export interface TaskExecuteResponse {
751
950
  /**
@@ -796,17 +995,15 @@ export interface TaskCreateParams {
796
995
  prompt?: string | null;
797
996
 
798
997
  /**
799
- * Flow-specific task configuration with versioning
998
+ * Flow-specific task configuration with type discriminator
800
999
  */
801
1000
  task_config?:
802
- | { [key: string]: unknown }
803
- | StandardPromptConfig
804
- | SearchV2Config
805
- | SearchV3Config
1001
+ | SearchTaskConfig
806
1002
  | IngestTaskConfig
807
- | SignalTopicConfigInput
808
- | SignalCsvConfigInput
809
- | SignalSheetConfigInput
1003
+ | ProfilePromptConfig
1004
+ | SignalTopicConfig
1005
+ | SignalCsvConfig
1006
+ | SignalSheetConfig
810
1007
  | null;
811
1008
  }
812
1009
 
@@ -837,17 +1034,15 @@ export interface TaskUpdateParams {
837
1034
  prompt?: string | null;
838
1035
 
839
1036
  /**
840
- * Updated flow-specific task configuration with versioning
1037
+ * Updated flow-specific task configuration with type discriminator
841
1038
  */
842
1039
  task_config?:
843
- | { [key: string]: unknown }
844
- | StandardPromptConfig
845
- | SearchV2Config
846
- | SearchV3Config
1040
+ | SearchTaskConfig
847
1041
  | IngestTaskConfig
848
- | SignalTopicConfigInput
849
- | SignalCsvConfigInput
850
- | SignalSheetConfigInput
1042
+ | ProfilePromptConfig
1043
+ | SignalTopicConfig
1044
+ | SignalCsvConfig
1045
+ | SignalSheetConfig
851
1046
  | null;
852
1047
  }
853
1048
 
@@ -892,14 +1087,20 @@ export interface TaskExecuteParams {
892
1087
 
893
1088
  export declare namespace Task {
894
1089
  export {
1090
+ type IngestPromptConfigResponse as IngestPromptConfigResponse,
895
1091
  type IngestTaskConfig as IngestTaskConfig,
896
- type SearchV2Config as SearchV2Config,
897
- type SearchV3Config as SearchV3Config,
898
- type SignalCsvConfigInput as SignalCsvConfigInput,
899
- type SignalSheetConfigInput as SignalSheetConfigInput,
900
- type SignalTopicConfigInput as SignalTopicConfigInput,
1092
+ type IngestTaskConfigResponse as IngestTaskConfigResponse,
1093
+ type ProfilePromptConfig as ProfilePromptConfig,
1094
+ type ProfilePromptConfigResponse as ProfilePromptConfigResponse,
1095
+ type SearchTaskConfig as SearchTaskConfig,
1096
+ type SearchTaskConfigResponse as SearchTaskConfigResponse,
1097
+ type SignalCsvConfig as SignalCsvConfig,
1098
+ type SignalCsvConfigResponse as SignalCsvConfigResponse,
1099
+ type SignalSheetConfig as SignalSheetConfig,
1100
+ type SignalSheetConfigResponse as SignalSheetConfigResponse,
1101
+ type SignalTopicConfig as SignalTopicConfig,
1102
+ type SignalTopicConfigResponse as SignalTopicConfigResponse,
901
1103
  type SignalTypeConfig as SignalTypeConfig,
902
- type StandardPromptConfig as StandardPromptConfig,
903
1104
  type TaskCreateResponse as TaskCreateResponse,
904
1105
  type TaskRetrieveResponse as TaskRetrieveResponse,
905
1106
  type TaskListResponse as TaskListResponse,